//package com.dpp;
//
//import com.dpp.context.BaseContext;
//import com.dpp.controller.user.AddressController;
//import com.dpp.controller.user.HomeController;
//import com.dpp.controller.user.OrderController;
//import com.dpp.dto.EditAddressDTO;
//import com.dpp.dto.OrderDTO;
//import com.dpp.dto.SaveAddressDTO;
//import com.dpp.entity.AddressBook;
//import com.dpp.entity.CouponBook;
//import com.dpp.entity.Orders;
//import com.dpp.entity.Users;
//import com.dpp.mapper.CouponBookMapper;
//import com.dpp.mapper.OrderMapper;
//import com.dpp.mapper.TestMapper;
//import com.dpp.mapper.UserMapper;
//import com.dpp.result.Result;
//import com.dpp.service.impl.OrderServiceImpl;
//import com.dpp.vo.*;
//import com.wechat.pay.contrib.apache.httpclient.exception.HttpCodeException;
//import com.wechat.pay.contrib.apache.httpclient.exception.NotFoundException;
//import org.junit.Test;
//import org.junit.runner.RunWith;
//import org.springframework.beans.factory.annotation.Autowired;
//import org.springframework.boot.test.context.SpringBootTest;
//import org.springframework.test.context.jdbc.Sql;
//import org.springframework.test.context.junit4.SpringRunner;
//
//import java.io.IOException;
//import java.net.URISyntaxException;
//import java.security.GeneralSecurityException;
//import java.time.LocalDate;
//import java.time.LocalDateTime;
//import java.time.LocalTime;
//import java.time.ZoneOffset;
//import java.util.List;
//
///**
// * ClassName:    GetAll
// * Package:  GetAll
// * Description:
// *
// *
// * @Author: Toykie
// * Create:   2023/10/15 -  12:07
// * @Version:
// */
//@RunWith(SpringRunner.class)
//@SpringBootTest(classes= DppServerApplication.class)
//public class test {
//
//
//
//    @Autowired
//    private HomeController homeController;
//
//    @Autowired
//    private OrderController orderController;
//
//    @Autowired
//    private AddressController addressController;
//
//    @Autowired
//    private CouponBookMapper couponBookMapper;
//
//    @Autowired
//    private TestMapper testMapper;
//
//    @Autowired
//    private OrderMapper orderMapper;
//
//    @Autowired
//    private UserMapper userMapper;
//
//
//    //-------------------------------------获取订单数据------------------------------
//
//    public void testTimeDaoxu(Result<List<HomeVO>> all){
//        System.out.println(all.getData());
//        long l1 = all.getData().get(0).getCreateTime().toEpochSecond(ZoneOffset.UTC);
//        for (int i=1;i<all.getData().size();i++){
//            long l2 = all.getData().get(i).getCreateTime().toEpochSecond(ZoneOffset.UTC);
//            assert l1>=l2:"时间倒序"+all.getData().get(i).getId();
//            l1=l2;
//        }
//    }
//
//
//    @Sql({"./order/getAll_order60_today.sql",
//             "users1.sql"})
//    @Test
//
//    public void testGetAll_A1(){
//        //Result<List<HomeVO>> all = homeController.getAll();
//        //assert all.getCode()==1:"今天未接订单60条";
//        //assert all.getData().size()==60 : "返回数据错误--今天未接订单60条";
//        //testTimeDaoxu(all);
//    }
//
//
//    @Sql({"./order/getAll_order60_yesterday.sql","users1.sql"})
//    @Test
//
//    public void testGetAll_A2(){
//        //Result<List<HomeVO>> all = homeController.getAll();
//        //assert all.getCode()==1:"今天未接订单45，昨天七点后未接订单15";
//        //assert all.getData().size()==60 : "返回数据错误----今天未接订单45，昨天七点后未接订单15";
//        //testTimeDaoxu(all);
//
//    }
//
//    @Sql({"./order/getAll_order60_lastday.sql","users1.sql"})
//    @Test
//    public void testGetAll_A3(){
//        //Result<List<HomeVO>> all = homeController.getAll();
//        //assert all.getCode()==1:"今天未接订单20，昨天未接订单20，前天未接订单20";
//        //assert all.getData().size()==60 : "错误条数，应为60条------今天未接订单20，昨天未接订单20，前天未接订单20";
//        //testTimeDaoxu(all);
//    }
//
//    @Sql({"order/getAll_finishOrder60_today.sql","users1.sql"})
//    @Test
//    public void testGetAll_B1(){
//        //Result<List<HomeVO>> all = homeController.getAll();
//        //assert all.getCode()==1:"今天非新增订单60条";
//        //assert all.getData().size()==50 : "错误条数，应为50条----今天非新增订单60条";
//        //testTimeDaoxu(all);
//
//    }
//    @Sql({"./order/getAll_finishOrder60_yesterday.sql","users1.sql"})
//    @Test
//    public void testGetAll_B2(){
//        //int t=0,y=0;
//        //Result<List<HomeVO>> all = homeController.getAll();
//        //assert all.getCode()==1:"今天非新增订单40,昨天20";
//        //LocalDate currentDate = LocalDate.now();  // 获取当前日期
//        //LocalDateTime currentDateTime = currentDate.atTime(LocalTime.MIN);  // 将当前日期转换为当天0时的 LocalDateTime 对象
//        //long l = currentDateTime.toEpochSecond(ZoneOffset.UTC);
//        //for (HomeVO datum : all.getData()) {
//        //    long l1 = datum.getCreateTime().toEpochSecond(ZoneOffset.UTC);
//        //    if(l1>l) t++;
//        //    else y++;
//        //}
//        //assert t==40 : "错误条数，应返回今天40条-----今天非新增订单40,昨天20";
//        //assert y==10 : "错误条数，应返回昨天10条-----今天非新增订单40,昨天20";
//        //testTimeDaoxu(all);
//
//    }
//
//    @Sql({"./order/getAll_finishOrder40_empty.sql","users1.sql"})
//    @Test
//
//    public void testGetAll_B3(){
//        //Result<List<HomeVO>> all = homeController.getAll();
//        //assert all.getCode()==1:"今天非新增订单40";
//        //assert all.getData().size()==40 : "错误条数，应为40条------今天非新增订单40";
//        //testTimeDaoxu(all);
//
//    }
//
//    @Sql({"./order/getAll_mixOrder60_today.sql","users1.sql"})
//    @Test
//    public void testGetAll_C1(){
//        //Result<List<HomeVO>> all = homeController.getAll();
//        //assert all.getCode()==1:"今天新增40，非新增20";
//        //int weijie=0,yijie=0;
//        //for (HomeVO datum : all.getData()) {
//        //    if(datum.getOrderStatus()==1) weijie++;
//        //    else yijie++;
//        //}
//        //assert weijie==40 : "错误条数，应返回40条未接订单------今天新增40，非新增20";
//        //assert yijie==10 : "错误条数，应返回10条非新增订单------今天新增40，非新增20";
//        //testTimeDaoxu(all);
//
//    }
//    @Sql({"./order/getAll_mixOrder60_yesterday.sql","users1.sql"})
//    @Test
//    public void testGetAll_C2(){
//
//        //Result<List<HomeVO>> all = homeController.getAll();
//        //assert all.getCode()==1:"今天新增40，非新增5，昨天非新增15条";
//        //int tweijie=0,tyijie=0,yyijie=0;
//        //LocalDate currentDate = LocalDate.now();  // 获取当前日期
//        //LocalDateTime currentDateTime = currentDate.atTime(LocalTime.MIN);  // 将当前日期转换为当天0时的 LocalDateTime 对象
//        //long l = currentDateTime.toEpochSecond(ZoneOffset.UTC);
//        //for (HomeVO datum : all.getData()) {
//        //    long l1 = datum.getCreateTime().toEpochSecond(ZoneOffset.UTC);
//        //    if (l1>l){
//        //        if(datum.getOrderStatus()==1) tweijie++;
//        //        else tyijie++;
//        //    }else yyijie++;
//        //}
//        //assert tweijie==40 : "错误条数，应返回40条今天未接订单------今天新增40，非新增5，昨天非新增15条";
//        //assert tyijie==5 : "错误条数，应返回5条今天已接订单------今天新增40，非新增5，昨天非新增15条";
//        //assert yyijie==5 : "错误条数，应返回5条昨天已接订单------今天新增40，非新增5，昨天非新增15条";
//        //
//        //
//        //long l1 = all.getData().get(0).getCreateTime().toEpochSecond(ZoneOffset.UTC);
//        //for (int i=1;i<40;i++){
//        //    long l2 = all.getData().get(i).getCreateTime().toEpochSecond(ZoneOffset.UTC);
//        //    assert l1>=l2:"时间倒序"+all.getData().get(i).getId();
//        //    l1=l2;
//        //}
//        //long l3 = all.getData().get(0).getCreateTime().toEpochSecond(ZoneOffset.UTC);
//        //
//        //for (int i=41;i<45;i++){
//        //    long l4 = all.getData().get(i).getCreateTime().toEpochSecond(ZoneOffset.UTC);
//        //    assert l3>=l4:"时间倒序"+all.getData().get(i).getId();
//        //    l3=l4;
//        //}
//        //long l5 = all.getData().get(0).getCreateTime().toEpochSecond(ZoneOffset.UTC);
//        //
//        //for (int i=46;i<50;i++){
//        //    long l6 = all.getData().get(i).getCreateTime().toEpochSecond(ZoneOffset.UTC);
//        //    assert l5>=l6:"时间倒序"+all.getData().get(i).getId();
//        //    l5=l6;
//        //}
//
//    }
//
//    @Sql({"./order/getAll_minOrder60_2.sql","users1.sql"})
//    @Test
//    public void testGetAll_C3(){
//
//        //Result<List<HomeVO>> all = homeController.getAll();
//        //assert all.getCode()==1:"今天新增20，非新增5，昨天新增20条，非新增15";
//        //int tweijie=0,tyijie=0,yyijie=0, yweijie=0;
//        //LocalDate currentDate = LocalDate.now();  // 获取当前日期
//        //LocalDateTime currentDateTime = currentDate.atTime(LocalTime.MIN);  // 将当前日期转换为当天0时的 LocalDateTime 对象
//        //long l = currentDateTime.toEpochSecond(ZoneOffset.UTC);
//        //for (HomeVO datum : all.getData()) {
//        //    long l1 = datum.getCreateTime().toEpochSecond(ZoneOffset.UTC);
//        //    if (l1>l){
//        //        if(datum.getOrderStatus()==1)tweijie++;
//        //        else tyijie++;
//        //    }else {
//        //        if(datum.getOrderStatus()==1) yweijie++;
//        //        else yyijie++;
//        //    }
//        //}
//        //assert tweijie==20 : "错误条数，应返回20条今天未接订单------今天新增20，非新增5，昨天新增20条，非新增15";
//        //assert tyijie==5 : "错误条数，应返回5条今天已接订单------今天新增20，非新增5，昨天新增20条，非新增15";
//        //assert yyijie==5 : "错误条数，应返回5条昨天已接订单------今天新增20，非新增5，昨天新增20条，非新增15";
//        //assert yweijie==20 : "错误条数，应返回20条昨天未接订单------今天新增20，非新增5，昨天新增20条，非新增15";
//        //
//        //
//        //long l1 = all.getData().get(0).getCreateTime().toEpochSecond(ZoneOffset.UTC);
//        //for (int i=1;i<40;i++){
//        //    long l2 = all.getData().get(i).getCreateTime().toEpochSecond(ZoneOffset.UTC);
//        //    assert l1>=l2:"时间倒序"+all.getData().get(i).getId();
//        //    l1=l2;
//        //}
//        //long l3 = all.getData().get(41).getCreateTime().toEpochSecond(ZoneOffset.UTC);
//        //
//        //for (int i=41;i<50;i++){
//        //    long l4 = all.getData().get(i).getCreateTime().toEpochSecond(ZoneOffset.UTC);
//        //    assert l3>=l4:"时间倒序"+all.getData().get(i).getId();
//        //    l3=l4;
//        //}
//    }
//
//    @Sql({"./order/getAll_minOrder60_3.sql","users1.sql"})
//    @Test
//    public void testGetAll_C4(){
//
//        //Result<List<HomeVO>> all = homeController.getAll();
//        //assert all.getCode()==1:"今天非新增35，昨天新增20条，非新增15";
//        //int tyijie=0,yyijie=0,yweijie=0;
//        //LocalDate currentDate = LocalDate.now();  // 获取当前日期
//        //LocalDateTime currentDateTime = currentDate.atTime(LocalTime.MIN);  // 将当前日期转换为当天0时的 LocalDateTime 对象
//        //long l = currentDateTime.toEpochSecond(ZoneOffset.UTC);
//        //for (HomeVO datum : all.getData()) {
//        //    long l1 = datum.getCreateTime().toEpochSecond(ZoneOffset.UTC);
//        //    if (l1>l){
//        //        if(datum.getOrderStatus()!=1)tyijie++;
//        //    }else {
//        //        if(datum.getOrderStatus()==1)yweijie++;
//        //        else yyijie++;
//        //    }
//        //}
//        //assert tyijie==30 : "错误条数，应返回30条今天已接订单------今天非新增35，昨天新增20条，非新增15";
//        //assert yyijie==0 : "错误条数，应返回0条昨天已接订单------今天非新增35，昨天新增20条，非新增15";
//        //assert yweijie==20 : "错误条数，应返回20条昨天未接订单------今天非新增35，昨天新增20条，非新增15";
//        //
//        //long l1 = all.getData().get(0).getCreateTime().toEpochSecond(ZoneOffset.UTC);
//        //for (int i=1;i<20;i++){
//        //    long l2 = all.getData().get(i).getCreateTime().toEpochSecond(ZoneOffset.UTC);
//        //    assert l1>=l2:"时间倒序"+all.getData().get(i).getId();
//        //    l1=l2;
//        //}
//        //long l3 = all.getData().get(21).getCreateTime().toEpochSecond(ZoneOffset.UTC);
//        //
//        //for (int i=21;i<50;i++){
//        //    long l4 = all.getData().get(i).getCreateTime().toEpochSecond(ZoneOffset.UTC);
//        //    assert l3>=l4:"时间倒序"+all.getData().get(i).getId();
//        //    l3=l4;
//        //}
//
//    }
//
//
//    //-------------------------------------接单------------------------------
//    @Sql({"./order/takeOrder_order1.sql","users1.sql"})
//    @Test
//    //接单
//    public void testTakeOrder1() throws GeneralSecurityException, NotFoundException, IOException, URISyntaxException, HttpCodeException {
//        BaseContext.setCurrentId("oD1dE6Ymphob6mNoG3Q6TA33pTkM");
//        Result<String> stringResult = orderController.takeOrder(Math.toIntExact(1));
//        System.out.println(stringResult.getCode());
//        System.out.println(stringResult.getMsg());
//        assert stringResult.getCode()==1:"接单成功";
//
//        List<Orders> orders = testMapper.selectAllOrders();
//        assert  orders.get(0).getOrderStatus()==2:"状态修改成功";
//        assert  orders.get(0).getAmount()==0.99:"金额不变";
//
//        assert  orders.get(1).getOrderStatus()==3:"其他订单状态不变";
//        assert  orders.get(1).getAmount()==0.99:"金额不变";
//
//    }
//    @Sql({"./order/takeOrder_order1.sql","users1.sql"})
//    @Test
//    //接单
//    public void testTakeOrder2() throws GeneralSecurityException, NotFoundException, IOException, URISyntaxException, HttpCodeException {
//        BaseContext.setCurrentId("oD1dE6e_B1ZunMSGLmHrWBUsPpSc");
//        Result<String> stringResult = orderController.takeOrder(Math.toIntExact(1));
//        System.out.println(stringResult.getCode());
//        System.out.println(stringResult.getMsg());
//        assert stringResult.getCode()==0:"接单失败，不是骑手";
//
//        List<Orders> orders = testMapper.selectAllOrders();
//        assert  orders.get(0).getOrderStatus()==1:"状态不变";
//        assert  orders.get(0).getAmount()==0.99:"金额不变";
//
//        assert  orders.get(1).getOrderStatus()==3:"其他订单状态不变";
//        assert  orders.get(1).getAmount()==0.99:"金额不变";
//    }
//    @Sql({"./order/takeOrder_order1.sql","users1.sql"})
//    @Test
//    //接单
//    public void testTakeOrder3() throws GeneralSecurityException, NotFoundException, IOException, URISyntaxException, HttpCodeException {
//        BaseContext.setCurrentId("oD1dE6RdILU9O-EXNaaOSc4cK2-g");
//        Result<String> stringResult = orderController.takeOrder(Math.toIntExact(1));
//        System.out.println(stringResult.getCode());
//        System.out.println(stringResult.getMsg());
//        assert stringResult.getCode()==0:"接单失败，没有信息地址";
//
//        List<Orders> orders = testMapper.selectAllOrders();
//        assert  orders.get(0).getOrderStatus()==1:"状态不变";
//        assert  orders.get(0).getAmount()==0.99:"金额不变";
//
//        assert  orders.get(1).getOrderStatus()==3:"其他订单状态不变";
//        assert  orders.get(1).getAmount()==0.99:"金额不变";
//    }
//    @Sql({"./order/takeOrder_order1.sql","users1.sql"})
//    @Test
//    //接单
//    public void testTakeOrder4() throws GeneralSecurityException, NotFoundException, IOException, URISyntaxException, HttpCodeException {
//        BaseContext.setCurrentId("oD1dE6RdILU9O-EXNaaOSc4cK2-g");
//        Result<String> stringResult = orderController.takeOrder(Math.toIntExact(2));
//        System.out.println(stringResult.getCode());
//        System.out.println(stringResult.getMsg());
//        assert stringResult.getCode()==0:"接单失败，状态不正确";
//
//
//        List<Orders> orders = testMapper.selectAllOrders();
//        assert  orders.get(0).getOrderStatus()==1:"状态不变";
//        assert  orders.get(0).getAmount()==0.99:"金额不变";
//
//        assert  orders.get(1).getOrderStatus()==3:"其他订单状态不变";
//        assert  orders.get(1).getAmount()==0.99:"金额不变";
//    }
//    @Sql({"./order/takeOrder_order1.sql","users1.sql"})
//    @Test
//    //接单
//    public void testTakeOrder5() throws GeneralSecurityException, NotFoundException, IOException, URISyntaxException, HttpCodeException {
//        BaseContext.setCurrentId("oD1dE6WKquXYcBKhX9vL9H90YsLk");
//        Result<String> stringResult = orderController.takeOrder(Math.toIntExact(2));
//        System.out.println(stringResult.getCode());
//        System.out.println(stringResult.getMsg());
//        assert stringResult.getCode()==0:"接单失败，接自己的单";
//
//        List<Orders> orders = testMapper.selectAllOrders();
//        assert  orders.get(0).getOrderStatus()==1:"状态不变";
//        assert  orders.get(0).getAmount()==0.99:"金额不变";
//
//        assert  orders.get(1).getOrderStatus()==3:"其他订单状态不变";
//        assert  orders.get(1).getAmount()==0.99:"金额不变";
//    }
//    //-------------------------------------获取下单信息------------------------------
//    @Sql({"./order/orders0.sql",
//            "./order/orders_detail0.sql"
//            , "./order/take_takeorders0.sql",
//            "users1.sql",
//            "address_InsertOne.sql"
//    })
//    @Test
//    //获取地址电话+优惠卷（只是更新页面信息而已）
//    public void testGetDA(){
//        BaseContext.setCurrentId("oD1dE6WKquXYcBKhX9vL9H90YsLk");
//        Result<OutOrderVO> da = addressController.getDA();
//        System.out.println(da);
//        assert da.getCode()==1:"获取下单信息";
//        assert da.getData().getAddress().equals("静园/静园1A/2楼/202")&&da.getData().getPhone().equals("18935372991");
//        //确保和数据库地址一致
//        for (AddressBook addressBook : testMapper.selectAddressBook()) {
//            if (addressBook.getIsDefault()==1)
//            {
//                assert da.getData().getAddress().equals(addressBook.getAddress());
//            }
//        }
//        //确保和数据库优惠券一致
//        List<CouponBook> couponBooks=testMapper.selectCouponBookByOpenid("oD1dE6WKquXYcBKhX9vL9H90YsLk");
//        for (CouponBook couponBook : couponBooks) {
//            assert couponBook.getCouponId()==1;
//        }
//
//    }
//    @Sql({"./order/orders0.sql",
//            "./order/orders_detail0.sql"
//            , "./order/take_takeorders0.sql",
//            "users1.sql",
//            "address_InsertOne.sql"
//    })
//
//
//    @Test
//    //获取地址电话+优惠卷（只是更新页面信息而已）
//    public void testGetDA_openid(){
//        BaseContext.setCurrentId("oD1Lk");
//        Result<OutOrderVO> da = addressController.getDA();
//        System.out.println(da);
//        assert da.getCode()==0&&da.getData()==null;
//    }
//
//
//
//    //------------------------------------发单:正确数据-------------------------------------
////    @Sql({"./order/orders0.sql",
////            "./order/orders_detail0.sql"
////             ,"users1.sql",
////            "./order/activity_record.sql"})
////    @Test
////    //发单
////    public void testDistribute_s1() throws GeneralSecurityException, NotFoundException, IOException, URISyntaxException, HttpCodeException {
////        BaseContext.setCurrentId("oD1dE6RdILU9O-EXNaaOSc4cK2-g");
////        OrderDTO orderDTO1=new OrderDTO();
////        orderDTO1.setPhone("18935372991");
////        orderDTO1.setAddress("静园1 一层 101(测试)");
////
////        LocalDate currentDate = LocalDate.now();
////        int month = currentDate.getMonthValue();
////        int day = currentDate.getDayOfMonth();
////        orderDTO1.setExpectTime(month+"-"+day+" 12:00-12:30");
////        orderDTO1.setPackageInfo("衣服 12-4-2345");
////        orderDTO1.setProductId(1);
////        //图片
////        //备注
////        orderDTO1.setAmount(0.33);
////        orderDTO1.setIsUseDiscount(false);
////        //优惠卷
//////        orderDTO.setCouponId();
////        Result submit = orderController.submit(orderDTO1);
////        assert submit.getCode()==1:"发首单";
////
////        int i = testMapper.selectByOpenidAmount();
////        assert i==1:"条数正确";
////
////        List<Orders> orders = orderMapper.selectOut1("oD1dE6RdILU9O-EXNaaOSc4cK2-g");
////        System.out.println(orders);
////        assert orders.get(0).getExpectTime().equals(month+"-"+day+" 12:00-12:30"):"ExpectTime错误";
////        assert orders.get(0).getAddress().equals("静园1 一层 101(测试)"):"Address错误";
////        assert orders.get(0).getPackageInfo().equals("衣服 12-4-2345"):"PackageInfo错误";
////        assert orders.get(0).getAmount()==0.33:"Amount错误";
////        assert orders.get(0).getPhone().equals("18935372991"):"Phone错误";
////        assert orders.get(0).getProductId()==1:"订单类型";
////        assert orders.get(0).getOrderStatus()==1:"订单状态";
////
////        Users users = userMapper.selectByOpenId("oD1dE6RdILU9O-EXNaaOSc4cK2-g");
////        assert users.getOrderTimes()==1;
////
////    }
////
////    @Sql({"./order/orders0.sql",
////            "./order/orders_detail0.sql"
////            ,"users1.sql"
////            ,"./order/activity_record.sql"})
////    @Test
////    //发单
////    public void testDistribute_f1() throws GeneralSecurityException, NotFoundException, IOException, URISyntaxException, HttpCodeException {
////        BaseContext.setCurrentId("oD1dE6RdILU9O-EXNaaOSc4cK2-g");
////        OrderDTO orderDTO1=new OrderDTO();
////        orderDTO1.setPhone("18935372991");
////        orderDTO1.setAddress("静园1 一层 101(测试)");
////
////        LocalDate currentDate = LocalDate.now();
////        int month = currentDate.getMonthValue();
////        int day = currentDate.getDayOfMonth();
////        orderDTO1.setExpectTime(month+"-"+day+" 12:00-12:30");
////        orderDTO1.setPackageInfo("衣服 12-4-2345");
////        orderDTO1.setProductId(1);
////        //图片
////        //备注
////        orderDTO1.setAmount(0.33);
////        orderDTO1.setIsUseDiscount(true);
////        //优惠卷
//////        orderDTO.setCouponId();
////        Result submit = orderController.submit(orderDTO1);
////        assert submit.getCode()==0:"发首单,使用优惠卷";
////
////        int i = testMapper.selectByOpenidAmount();
////        assert i==0:"条数正确";
////
////        Users users = userMapper.selectByOpenId("oD1dE6RdILU9O-EXNaaOSc4cK2-g");
////        assert users.getOrderTimes()==0;
////
////    }
////
////
////
////    @Sql({"./order/orders1.sql",
////            "./order/orders_detail1.sql"
////            ,"users1.sql",
////            "./order/coupon.sql",
////            "./order/coupon_book.sql"
////    ,"./order/activity_record.sql"})
////    @Test
////    //发单
////    public void testDistribute_s2() throws GeneralSecurityException, NotFoundException, IOException, URISyntaxException, HttpCodeException {
////        BaseContext.setCurrentId("oD1dE6WKquXYcBKhX9vL9H90YsLk");
////        OrderDTO orderDTO1=new OrderDTO();
////        orderDTO1.setPhone("18935372991");
////        orderDTO1.setAddress("静园1 一层 101(测试)");
////        LocalDate currentDate = LocalDate.now();
////        int month = currentDate.getMonthValue();
////        String  day = String.valueOf(currentDate.getDayOfMonth());
////        if(Integer.parseInt(day)<10){
////            day="0"+day;
////        }
////        orderDTO1.setExpectTime(month+"-"+day+" 12:00-12:30");
////        orderDTO1.setPackageInfo("衣服 12-4-2345");
////        orderDTO1.setProductId(1);
////
////        //图片
////        //备注
////        orderDTO1.setAmount(0.49);
////        orderDTO1.setIsUseDiscount(true);
////        orderDTO1.setCouponId(1);
////        Result submit = orderController.submit(orderDTO1);
////        System.out.println(submit);
////        assert submit.getCode()==1:"使用优惠卷";
////
////
////        int i = testMapper.selectByOpenidAmount();
////        assert i==2:"条数正确";
////
////        List<Orders> orders = orderMapper.selectOut1("oD1dE6WKquXYcBKhX9vL9H90YsLk");
////        System.out.println(orders);
////
////        assert orders.get(0).getExpectTime().equals(month+"-"+day+" 12:00-12:30"):"ExpectTime错误";
////        assert orders.get(0).getAddress().equals("静园13 A二层 2022"):"Address错误";
////        assert orders.get(0).getPackageInfo().equals("asfa"):"PackageInfo错误";
////        assert orders.get(0).getAmount()==0.99:"Amount错误";
////        assert orders.get(0).getPhone().equals("18935372991"):"Phone错误";
////        assert orders.get(0).getProductId()==1:"订单类型";
////        assert orders.get(0).getOrderStatus()==4:"订单状态";
////
////
////
////        assert orders.get(1).getExpectTime().equals(month+"-"+day+" 12:00-12:30"):"ExpectTime错误";
////        assert orders.get(1).getAddress().equals("静园1 一层 101(测试)"):"Address错误";
////        assert orders.get(1).getPackageInfo().equals("衣服 12-4-2345"):"PackageInfo错误";
////        assert orders.get(1).getAmount()==0.49:"Amount错误";
////        assert orders.get(1).getPhone().equals("18935372991"):"Phone错误";
////        assert orders.get(1).getProductId()==1:"订单类型";
////        assert orders.get(1).getOrderStatus()==1:"订单状态";
////
////        CouponBook couponBook = couponBookMapper.selectByOpenid111("oD1dE6WKquXYcBKhX9vL9H90YsLk", 1);
////        assert couponBook.getCount()==1:"优惠卷数量";
////    }
////
////    @Sql({"./order/orders1.sql",
////            "./order/orders_detail1.sql"
////            ,"users1.sql",
////            "./order/coupon.sql",
////            "./order/coupon_book.sql"
////            ,"./order/activity_record1.sql"})
////    @Test
////    //发单
////    public void testDistribute_f2() throws GeneralSecurityException, NotFoundException, IOException, URISyntaxException, HttpCodeException {
////        BaseContext.setCurrentId("oD1dE6WKquXYcBKhX9vL9H90YsLk");
////        OrderDTO orderDTO1=new OrderDTO();
////        orderDTO1.setPhone("18935372991");
////        orderDTO1.setAddress("静园1 一层 101(测试)");
////        LocalDate currentDate = LocalDate.now();
////        int month = currentDate.getMonthValue();
////        String  day = String.valueOf(currentDate.getDayOfMonth());
////        if(Integer.parseInt(day)<10){
////            day="0"+day;
////        }
////        orderDTO1.setExpectTime(month+"-"+day+" 12:00-12:30");
////        orderDTO1.setPackageInfo("衣服 12-4-2345");
////        orderDTO1.setProductId(1);
////
////        //图片
////        //备注
////        orderDTO1.setAmount(0.49);
////        orderDTO1.setIsUseDiscount(true);
////        orderDTO1.setCouponId(1);
////        Result submit = orderController.submit(orderDTO1);
////        System.out.println(submit);
////        assert submit.getCode()==1:"使用优惠卷";
////
////
////        int i = testMapper.selectByOpenidAmount();
////        assert i==2:"条数正确";
////
////        List<Orders> orders = orderMapper.selectOut1("oD1dE6WKquXYcBKhX9vL9H90YsLk");
////        System.out.println(orders);
////
////        assert orders.get(0).getExpectTime().equals(month+"-"+day+" 12:00-12:30"):"ExpectTime错误";
////        assert orders.get(0).getAddress().equals("静园13 A二层 2022"):"Address错误";
////        assert orders.get(0).getPackageInfo().equals("asfa"):"PackageInfo错误";
////        assert orders.get(0).getAmount()==0.99:"Amount错误";
////        assert orders.get(0).getPhone().equals("18935372991"):"Phone错误";
////        assert orders.get(0).getProductId()==1:"订单类型";
////        assert orders.get(0).getOrderStatus()==4:"订单状态";
////
////
////
////        assert orders.get(1).getExpectTime().equals(month+"-"+day+" 12:00-12:30"):"ExpectTime错误";
////        assert orders.get(1).getAddress().equals("静园1 一层 101(测试)"):"Address错误";
////        assert orders.get(1).getPackageInfo().equals("衣服 12-4-2345"):"PackageInfo错误";
////        assert orders.get(1).getAmount()==0.49:"Amount错误";
////        assert orders.get(1).getPhone().equals("18935372991"):"Phone错误";
////        assert orders.get(1).getProductId()==1:"订单类型";
////        assert orders.get(1).getOrderStatus()==1:"订单状态";
////    }
////
////
////    @Sql({"./order/orders1.sql",
////            "./order/orders_detail1.sql"
////            ,"users1.sql",
////            "./order/coupon.sql",
////            "./order/coupon_book.sql"
////            ,"./order/activity_record1.sql" })
////    @Test
////    //发单
////    public void testDistribute_s3() throws GeneralSecurityException, NotFoundException, IOException, URISyntaxException, HttpCodeException {
////        BaseContext.setCurrentId("oD1dE6WKquXYcBKhX9vL9H90YsLk");
////        OrderDTO orderDTO1=new OrderDTO();
////        orderDTO1.setPhone("18935372991");
////        orderDTO1.setAddress("静园1 一层 101(测试)");
////        LocalDate currentDate = LocalDate.now();
////        int month = currentDate.getMonthValue();
////        String  day = String.valueOf(currentDate.getDayOfMonth());
////        if(Integer.parseInt(day)<10){
////            day="0"+day;
////        }
////        orderDTO1.setExpectTime(month+"-"+day+" 12:00-12:30");
////
////        orderDTO1.setPackageInfo("衣服 12-4-2345");
////        orderDTO1.setProductId(1);
////        //图片
////        //备注
////        orderDTO1.setAmount(0.99);
////        orderDTO1.setIsUseDiscount(false);
////        //优惠卷
//////        orderDTO.setCouponId();
////        Result submit = orderController.submit(orderDTO1);
////        assert submit.getCode()==1:"不用优惠卷";
////
////        int i = testMapper.selectByOpenidAmount();
////        assert i==2:"条数正确";
////
////        List<Orders> orders = orderMapper.selectOut1("oD1dE6WKquXYcBKhX9vL9H90YsLk");
////        System.out.println(orders);
////        assert orders.get(0).getExpectTime().equals(month+"-"+day+" 12:00-12:30"):"ExpectTime错误";
////        assert orders.get(0).getAddress().equals("静园13 A二层 2022"):"Address错误";
////        assert orders.get(0).getPackageInfo().equals("asfa"):"PackageInfo错误";
////        assert orders.get(0).getAmount()==0.99:"Amount错误";
////        assert orders.get(0).getPhone().equals("18935372991"):"Phone错误";
////        assert orders.get(0).getProductId()==1:"订单类型";
////        assert orders.get(0).getOrderStatus()==4:"订单状态";
////
////
////        assert orders.get(1).getExpectTime().equals(month+"-"+day+" 12:00-12:30"):"ExpectTime错误";
////        assert orders.get(1).getAddress().equals("静园1 一层 101(测试)"):"Address错误";
////        assert orders.get(1).getPackageInfo().equals("衣服 12-4-2345"):"PackageInfo错误";
////        assert orders.get(1).getAmount()==0.99:"Amount错误";
////        assert orders.get(1).getPhone().equals("18935372991"):"Phone错误";
////        assert orders.get(1).getProductId()==1:"订单类型";
////        assert orders.get(1).getOrderStatus()==1:"订单状态";
////    }
////
////    @Sql({"./order/orders1.sql",
////            "./order/orders_detail1.sql"
////            ,"users1.sql",
////            "./order/coupon.sql",
////            "./order/coupon_book.sql"
////            ,"./order/activity_record.sql" })
////    @Test
////    //发单
////    public void testDistribute_f3() throws GeneralSecurityException, NotFoundException, IOException, URISyntaxException, HttpCodeException {
////        BaseContext.setCurrentId("oD1dE6WKquXYcBKhX9vL9H90YsLk");
////        OrderDTO orderDTO1=new OrderDTO();
////        orderDTO1.setPhone("18935372991");
////        orderDTO1.setAddress("静园1 一层 101(测试)");
////        LocalDate currentDate = LocalDate.now();
////        int month = currentDate.getMonthValue();
////        String  day = String.valueOf(currentDate.getDayOfMonth());
////        if(Integer.parseInt(day)<10){
////            day="0"+day;
////        }
////        orderDTO1.setExpectTime(month+"-"+day+" 12:00-12:30");
////
////        orderDTO1.setPackageInfo("衣服 12-4-2345");
////        orderDTO1.setProductId(1);
////        //图片
////        //备注
////        orderDTO1.setAmount(0.99);
////        orderDTO1.setIsUseDiscount(false);
////        //优惠卷
//////        orderDTO.setCouponId();
////        Result submit = orderController.submit(orderDTO1);
////        assert submit.getCode()==1:"不用优惠卷";
////
////        int i = testMapper.selectByOpenidAmount();
////        assert i==2:"条数正确";
////
////        List<Orders> orders = orderMapper.selectOut1("oD1dE6WKquXYcBKhX9vL9H90YsLk");
////        System.out.println(orders);
////        assert orders.get(0).getExpectTime().equals(month+"-"+day+" 12:00-12:30"):"ExpectTime错误";
////        assert orders.get(0).getAddress().equals("静园13 A二层 2022"):"Address错误";
////        assert orders.get(0).getPackageInfo().equals("asfa"):"PackageInfo错误";
////        assert orders.get(0).getAmount()==0.99:"Amount错误";
////        assert orders.get(0).getPhone().equals("18935372991"):"Phone错误";
////        assert orders.get(0).getProductId()==1:"订单类型";
////        assert orders.get(0).getOrderStatus()==4:"订单状态";
////
////
////        assert orders.get(1).getExpectTime().equals(month+"-"+day+" 12:00-12:30"):"ExpectTime错误";
////        assert orders.get(1).getAddress().equals("静园1 一层 101(测试)"):"Address错误";
////        assert orders.get(1).getPackageInfo().equals("衣服 12-4-2345"):"PackageInfo错误";
////        assert orders.get(1).getAmount()==0.33:"Amount错误";
////        assert orders.get(1).getPhone().equals("18935372991"):"Phone错误";
////        assert orders.get(1).getProductId()==1:"订单类型";
////        assert orders.get(1).getOrderStatus()==1:"订单状态";
////    }
////
////
////
////    //------------------------------------发单:数据为空-------------------------------------
////    @Sql({"./order/orders1.sql",
////            "./order/orders_detail1.sql"
////            ,"users1.sql",
////            "./order/coupon.sql",
////            "./order/coupon_book.sql"
////            ,"./order/activity_record.sql"})
////    @Test
////    //发单
////    public void testDistribute_f1_phone() throws GeneralSecurityException, NotFoundException, IOException, URISyntaxException, HttpCodeException {
////        BaseContext.setCurrentId("oD1dE6WKquXYcBKhX9vL9H90YsLk");
////        OrderDTO orderDTO1=new OrderDTO();
//////        orderDTO1.setPhone("18935372991");
////        orderDTO1.setAddress("静园1 一层 101(测试)");
////        LocalDate currentDate = LocalDate.now();
////        int month = currentDate.getMonthValue();
////        String  day = String.valueOf(currentDate.getDayOfMonth());
////        if(Integer.parseInt(day)<10){
////            day="0"+day;
////        }
////        orderDTO1.setExpectTime(month+"-"+day+" 12:00-12:30");
////        orderDTO1.setPackageInfo("衣服 12-4-2345");
////        orderDTO1.setProductId(1);
////        //图片
////        //备注
////        orderDTO1.setAmount(0.99);
////        orderDTO1.setIsUseDiscount(false);
////        //优惠卷
//////        orderDTO.setCouponId();
////        Result submit = orderController.submit(orderDTO1);
////        assert submit.getCode()==0:"电话为空";
////        int i = testMapper.selectByOpenidAmount();
////        assert i==1:"条数错误，电话为空，应插入失败";
////
////        List<Orders> orders = orderMapper.selectOut1("oD1dE6WKquXYcBKhX9vL9H90YsLk");
////        System.out.println(orders);
////
////        String s = month + "-" + day + " 12:00-12:30";
////        String expectTime = orders.get(0).getExpectTime();
////        assert orders.get(0).getExpectTime().equals(month+"-"+day+" 12:00-12:30"):"ExpectTime错误";
////
////        assert orders.get(0).getAddress().equals("静园13 A二层 2022"):"Address错误";
////        assert orders.get(0).getPackageInfo().equals("asfa"):"PackageInfo错误";
////        assert orders.get(0).getAmount()==0.99:"Amount错误";
////        assert orders.get(0).getPhone().equals("18935372991"):"Phone错误";
////        assert orders.get(0).getProductId()==1:"订单类型";
////        assert orders.get(0).getOrderStatus()==4:"订单状态";
////
////    }
////    @Sql({"./order/orders1.sql",
////            "./order/orders_detail1.sql"
////            ,"users1.sql",
////            "./order/coupon.sql",
////            "./order/coupon_book.sql"
////            ,"./order/activity_record.sql"})
////    @Test
////    //发单
////    public void testDistribute_f1_address() throws GeneralSecurityException, NotFoundException, IOException, URISyntaxException, HttpCodeException {
////        BaseContext.setCurrentId("oD1dE6WKquXYcBKhX9vL9H90YsLk");
////        OrderDTO orderDTO1=new OrderDTO();
////        orderDTO1.setPhone("18935372991");
//////        orderDTO1.setAddress("静园1 一层 101(测试)");
////        LocalDate currentDate = LocalDate.now();
////        int month = currentDate.getMonthValue();
////        String  day = String.valueOf(currentDate.getDayOfMonth());
////        if(Integer.parseInt(day)<10){
////            day="0"+day;
////        }
////        orderDTO1.setExpectTime(month+"-"+day+" 12:00-12:30");
////        orderDTO1.setPackageInfo("衣服 12-4-2345");
////        orderDTO1.setProductId(1);
////
////        //图片
////        //备注
////        orderDTO1.setAmount(0.99);
////        orderDTO1.setIsUseDiscount(false);
////        //优惠卷
//////        orderDTO.setCouponId();
////        Result submit = orderController.submit(orderDTO1);
////        assert submit.getCode()==0:"地址为空";
////        int i = testMapper.selectByOpenidAmount();
////        assert i==1:"条数错误，地址为空，应插入失败";
////
////        List<Orders> orders = orderMapper.selectOut1("oD1dE6WKquXYcBKhX9vL9H90YsLk");
////        System.out.println(orders);
////        assert orders.get(0).getExpectTime().equals(month+"-"+day+" 12:00-12:30"):"ExpectTime错误";
////        assert orders.get(0).getAddress().equals("静园13 A二层 2022"):"Address错误";
////        assert orders.get(0).getPackageInfo().equals("asfa"):"PackageInfo错误";
////        assert orders.get(0).getAmount()==0.99:"Amount错误";
////        assert orders.get(0).getPhone().equals("18935372991"):"Phone错误";
////        assert orders.get(0).getProductId()==1:"订单类型";
////        assert orders.get(0).getOrderStatus()==4:"订单状态";
////    }
////    @Sql({"./order/orders1.sql",
////            "./order/orders_detail1.sql"
////            ,"users1.sql",
////            "./order/coupon.sql",
////            "./order/coupon_book.sql"
////            ,"./order/activity_record.sql"})
////    @Test
////    //发单
////    public void testDistribute_f1_expectTime() throws GeneralSecurityException, NotFoundException, IOException, URISyntaxException, HttpCodeException {
////        BaseContext.setCurrentId("oD1dE6WKquXYcBKhX9vL9H90YsLk");
////        OrderDTO orderDTO1=new OrderDTO();
////        orderDTO1.setPhone("18935372991");
////        orderDTO1.setAddress("静园1 一层 101(测试)");
//////        LocalDate currentDate = LocalDate.now();
//////        int month = currentDate.getMonthValue();
//////        int day = currentDate.getDayOfMonth();
//////        orderDTO1.setExpectTime(month+"-"+day+" 12:00-12:30");
////        orderDTO1.setPackageInfo("衣服 12-4-2345");
////        orderDTO1.setProductId(1);
////
////        //图片
////        //备注
////        orderDTO1.setAmount(0.99);
////        orderDTO1.setIsUseDiscount(false);
////        //优惠卷
//////        orderDTO.setCouponId();
////        Result submit = orderController.submit(orderDTO1);
////        assert submit.getCode()==0:"期望时间为空";
////        int i = testMapper.selectByOpenidAmount();
////        assert i==1:"条数错误，期望时间为空，应插入失败";
////
////        List<Orders> orders = orderMapper.selectOut1("oD1dE6WKquXYcBKhX9vL9H90YsLk");
////        System.out.println(orders);
////        LocalDate currentDate = LocalDate.now();
////        int month = currentDate.getMonthValue();
////        String  day = String.valueOf(currentDate.getDayOfMonth());
////        if(Integer.parseInt(day)<10){
////            day="0"+day;
////        }
////        assert orders.get(0).getExpectTime().equals(month+"-"+day+" 12:00-12:30"):"ExpectTime错误";
////        assert orders.get(0).getAddress().equals("静园13 A二层 2022"):"Address错误";
////        assert orders.get(0).getPackageInfo().equals("asfa"):"PackageInfo错误";
////        assert orders.get(0).getAmount()==0.99:"Amount错误";
////        assert orders.get(0).getPhone().equals("18935372991"):"Phone错误";
////        assert orders.get(0).getProductId()==1:"订单类型";
////        assert orders.get(0).getOrderStatus()==4:"订单状态";
////    }
////    @Sql({"./order/orders1.sql",
////            "./order/orders_detail1.sql"
////            ,"users1.sql",
////            "./order/coupon.sql",
////            "./order/coupon_book.sql"
////            ,"./order/activity_record.sql"})
////    @Test
////    //发单
////    public void testDistribute_f1_PackageInfo() throws GeneralSecurityException, NotFoundException, IOException, URISyntaxException, HttpCodeException {
////        BaseContext.setCurrentId("oD1dE6WKquXYcBKhX9vL9H90YsLk");
////        OrderDTO orderDTO1=new OrderDTO();
////        orderDTO1.setPhone("18935372991");
////        orderDTO1.setAddress("静园1 一层 101(测试)");
////        LocalDate currentDate = LocalDate.now();
////        int month = currentDate.getMonthValue();
////        String  day = String.valueOf(currentDate.getDayOfMonth());
////        if(Integer.parseInt(day)<10){
////            day="0"+day;
////        }
////        orderDTO1.setExpectTime(month+"-"+day+" 12:00-12:30");
//////        orderDTO1.setPackageInfo("衣服 12-4-2345");
////        orderDTO1.setProductId(1);
////
////        //图片
////        //备注
////        orderDTO1.setAmount(0.99);
////        orderDTO1.setIsUseDiscount(false);
////        //优惠卷
//////        orderDTO.setCouponId();
////        Result submit = orderController.submit(orderDTO1);
////        assert submit.getCode()==0:"信息为空";
////        int i = testMapper.selectByOpenidAmount();
////        assert i==1:"条数错误，信息为空，应插入失败";
////
////        List<Orders> orders = orderMapper.selectOut1("oD1dE6WKquXYcBKhX9vL9H90YsLk");
////        System.out.println(orders);
////
////        assert orders.get(0).getExpectTime().equals(month+"-"+day+" 12:00-12:30"):"ExpectTime错误";
////        assert orders.get(0).getAddress().equals("静园13 A二层 2022"):"Address错误";
////        assert orders.get(0).getPackageInfo().equals("asfa"):"PackageInfo错误";
////        assert orders.get(0).getAmount()==0.99:"Amount错误";
////        assert orders.get(0).getPhone().equals("18935372991"):"Phone错误";
////        assert orders.get(0).getProductId()==1:"订单类型";
////        assert orders.get(0).getOrderStatus()==4:"订单状态";
////    }
////    @Sql({"./order/orders1.sql",
////            "./order/orders_detail1.sql"
////            ,"users1.sql",
////            "./order/coupon.sql",
////            "./order/coupon_book.sql"
////            ,"./order/activity_record.sql"})
////    @Test
////    //发单
////    public void testDistribute_f1_Amount() throws GeneralSecurityException, NotFoundException, IOException, URISyntaxException, HttpCodeException {
////        BaseContext.setCurrentId("oD1dE6WKquXYcBKhX9vL9H90YsLk");
////        OrderDTO orderDTO1=new OrderDTO();
////        orderDTO1.setPhone("18935372991");
////        orderDTO1.setAddress("静园1 一层 101(测试)");
////        LocalDate currentDate = LocalDate.now();
////        int month = currentDate.getMonthValue();
////        String  day = String.valueOf(currentDate.getDayOfMonth());
////        if(Integer.parseInt(day)<10){
////            day="0"+day;
////        }
////        orderDTO1.setExpectTime(month+"-"+day+" 12:00-12:30");
////        orderDTO1.setPackageInfo("衣服 12-4-2345");
////        orderDTO1.setProductId(1);
////
////        //图片
////        //备注
//////        orderDTO1.setAmount(0.99);
////        orderDTO1.setIsUseDiscount(false);
////        //优惠卷
//////        orderDTO.setCouponId();
////        Result submit = orderController.submit(orderDTO1);
////        assert submit.getCode()==0:"金额为空";
////        int i = testMapper.selectByOpenidAmount();
////        assert i==1:"条数错误，金额为空，应插入失败";
////
////        List<Orders> orders = orderMapper.selectOut1("oD1dE6WKquXYcBKhX9vL9H90YsLk");
////        System.out.println(orders);
////
////        assert orders.get(0).getExpectTime().equals(month+"-"+day+" 12:00-12:30"):"ExpectTime错误";
////        assert orders.get(0).getAddress().equals("静园13 A二层 2022"):"Address错误";
////        assert orders.get(0).getPackageInfo().equals("asfa"):"PackageInfo错误";
////        assert orders.get(0).getAmount()==0.99:"Amount错误";
////        assert orders.get(0).getPhone().equals("18935372991"):"Phone错误";
////        assert orders.get(0).getProductId()==1:"订单类型";
////        assert orders.get(0).getOrderStatus()==4:"订单状态";
////    }
////    @Sql({"./order/orders1.sql",
////            "./order/orders_detail1.sql"
////            ,"users1.sql",
////            "./order/coupon.sql",
////            "./order/coupon_book.sql"
////            ,"./order/activity_record1.sql"})
////    @Test
////    //发单
////    public void testDistribute_f1_CouponId() throws GeneralSecurityException, NotFoundException, IOException, URISyntaxException, HttpCodeException {
////        BaseContext.setCurrentId("oD1dE6WKquXYcBKhX9vL9H90YsLk");
////        OrderDTO orderDTO1=new OrderDTO();
////        orderDTO1.setPhone("18935372991");
////        orderDTO1.setAddress("静园1 一层 101(测试)");
////        LocalDate currentDate = LocalDate.now();
////        int month = currentDate.getMonthValue();
////        String  day = String.valueOf(currentDate.getDayOfMonth());
////        if(Integer.parseInt(day)<10){
////            day="0"+day;
////        }
////        orderDTO1.setExpectTime(month+"-"+day+" 12:00-12:30");
////        orderDTO1.setPackageInfo("衣服 12-4-2345");
////        orderDTO1.setProductId(1);
////
////        //图片
////        //备注
////        orderDTO1.setAmount(0.49);
////        orderDTO1.setIsUseDiscount(true);
////        //优惠卷
//////        orderDTO.setCouponId();
////        Result submit = orderController.submit(orderDTO1);
////        assert submit.getCode()==0:"优惠卷为空";
////        int i = testMapper.selectByOpenidAmount();
////        assert i==1:"条数错误，优惠卷为空，应插入失败";
////
////        List<Orders> orders = orderMapper.selectOut1("oD1dE6WKquXYcBKhX9vL9H90YsLk");
////        System.out.println(orders);
////
////        assert orders.get(0).getExpectTime().equals(month+"-"+day+" 12:00-12:30"):"ExpectTime错误";
////        assert orders.get(0).getAddress().equals("静园13 A二层 2022"):"Address错误";
////        assert orders.get(0).getPackageInfo().equals("asfa"):"PackageInfo错误";
////        assert orders.get(0).getAmount()==0.99:"Amount错误";
////        assert orders.get(0).getPhone().equals("18935372991"):"Phone错误";
////        assert orders.get(0).getProductId()==1:"订单类型";
////        assert orders.get(0).getOrderStatus()==4:"订单状态";
////    }
////    @Sql({"./order/orders1.sql",
////            "./order/orders_detail1.sql"
////            ,"users1.sql",
////            "./order/coupon.sql",
////            "./order/coupon_book.sql"
////            ,"./order/activity_record1.sql"})
////    @Test
////    //发单
////    public void testDistribute_f1_CouponIderror() throws GeneralSecurityException, NotFoundException, IOException, URISyntaxException, HttpCodeException {
////        BaseContext.setCurrentId("oD1dE6WKquXYcBKhX9vL9H90YsLk");
////        OrderDTO orderDTO1=new OrderDTO();
////        orderDTO1.setPhone("18935372991");
////        orderDTO1.setAddress("静园1 一层 101(测试)");
////        LocalDate currentDate = LocalDate.now();
////        int month = currentDate.getMonthValue();
////        String  day = String.valueOf(currentDate.getDayOfMonth());
////        if(Integer.parseInt(day)<10){
////            day="0"+day;
////        }
////        orderDTO1.setExpectTime(month+"-"+day+" 12:00-12:30");
////        orderDTO1.setPackageInfo("衣服 12-4-2345");
////        orderDTO1.setProductId(1);
////
////        //图片
////        //备注
////        orderDTO1.setAmount(0.49);
////        orderDTO1.setIsUseDiscount(true);
////        //优惠卷
////        orderDTO1.setCouponId(22222);
////        Result submit = orderController.submit(orderDTO1);
////        assert submit.getCode()==0:"优惠卷id错误";
////        int i = testMapper.selectByOpenidAmount();
////        assert i==1:"条数错误，优惠卷id错误，应插入失败";
////
////        List<Orders> orders = orderMapper.selectOut1("oD1dE6WKquXYcBKhX9vL9H90YsLk");
////        System.out.println(orders);
////
////        assert orders.get(0).getExpectTime().equals(month+"-"+day+" 12:00-12:30"):"ExpectTime错误";
////        assert orders.get(0).getAddress().equals("静园13 A二层 2022"):"Address错误";
////        assert orders.get(0).getPackageInfo().equals("asfa"):"PackageInfo错误";
////        assert orders.get(0).getAmount()==0.99:"Amount错误";
////        assert orders.get(0).getPhone().equals("18935372991"):"Phone错误";
////        assert orders.get(0).getProductId()==1:"订单类型";
////        assert orders.get(0).getOrderStatus()==4:"订单状态";
////    }
////    @Sql({"./order/orders1.sql",
////            "./order/orders_detail1.sql"
////            ,"users1.sql",
////            "./order/coupon.sql",
////            "./order/coupon_book.sql"
////            ,"./order/activity_record.sql"})
////    @Test
////    //发单
////    public void testDistribute_f1_productid() throws GeneralSecurityException, NotFoundException, IOException, URISyntaxException, HttpCodeException {
////        BaseContext.setCurrentId("oD1dE6WKquXYcBKhX9vL9H90YsLk");
////        OrderDTO orderDTO1=new OrderDTO();
////        orderDTO1.setPhone("18935372991");
////        orderDTO1.setAddress("静园1 一层 101(测试)");
////        LocalDate currentDate = LocalDate.now();
////        int month = currentDate.getMonthValue();
////        String  day = String.valueOf(currentDate.getDayOfMonth());
////        if(Integer.parseInt(day)<10){
////            day="0"+day;
////        }
////        orderDTO1.setExpectTime(month+"-"+day+" 12:00-12:30");
////        orderDTO1.setPackageInfo("衣服 12-4-2345");
//////        orderDTO1.setProductId(1);
////
////        //图片
////        //备注
////        orderDTO1.setAmount(0.49);
////        orderDTO1.setIsUseDiscount(true);
////        //优惠卷
////        orderDTO1.setCouponId(1);
////        Result submit = orderController.submit(orderDTO1);
////        assert submit.getCode()==0:"订单类型为空";
////        int i = testMapper.selectByOpenidAmount();
////        assert i==1:"条数错误，订单类型为空，应插入失败";
////
////        List<Orders> orders = orderMapper.selectOut1("oD1dE6WKquXYcBKhX9vL9H90YsLk");
////
////        assert orders.get(0).getExpectTime().equals(month+"-"+day+" 12:00-12:30"):"ExpectTime错误";
////        assert orders.get(0).getAddress().equals("静园13 A二层 2022"):"Address错误";
////        assert orders.get(0).getPackageInfo().equals("asfa"):"PackageInfo错误";
////        assert orders.get(0).getAmount()==0.99:"Amount错误";
////        assert orders.get(0).getPhone().equals("18935372991"):"Phone错误";
////        assert orders.get(0).getProductId()==1:"订单类型";
////        assert orders.get(0).getOrderStatus()==4:"订单状态";
////    }
////    @Sql({"./order/orders1.sql",
////            "./order/orders_detail1.sql"
////            ,"users1.sql",
////            "./order/coupon.sql",
////            "./order/coupon_book.sql"
////            ,"./order/activity_record.sql"})
////    @Test
////    //发单
////    public void testDistribute_f1_productiderror() throws GeneralSecurityException, NotFoundException, IOException, URISyntaxException, HttpCodeException {
////        BaseContext.setCurrentId("oD1dE6WKquXYcBKhX9vL9H90YsLk");
////        OrderDTO orderDTO1=new OrderDTO();
////        orderDTO1.setPhone("18935372991");
////        orderDTO1.setAddress("静园1 一层 101(测试)");
////        LocalDate currentDate = LocalDate.now();
////        int month = currentDate.getMonthValue();
////        String  day = String.valueOf(currentDate.getDayOfMonth());
////        if(Integer.parseInt(day)<10){
////            day="0"+day;
////        }
////        orderDTO1.setExpectTime(month+"-"+day+" 12:00-12:30");
////        orderDTO1.setPackageInfo("衣服 12-4-2345");
////        orderDTO1.setProductId(111111);
////
////        //图片
////        //备注
////        orderDTO1.setAmount(0.49);
////        orderDTO1.setIsUseDiscount(true);
////        //优惠卷
//////        orderDTO.setCouponId();
////        Result submit = orderController.submit(orderDTO1);
////        assert submit.getCode()==0:"订单类型错误";
////        int i = testMapper.selectByOpenidAmount();
////        assert i==1:"条数错误，订单类型错误，应插入失败";
////
////        List<Orders> orders = orderMapper.selectOut1("oD1dE6WKquXYcBKhX9vL9H90YsLk");
////        System.out.println(orders);
////
////        assert orders.get(0).getExpectTime().equals(month+"-"+day+" 12:00-12:30"):"ExpectTime错误";
////        assert orders.get(0).getAddress().equals("静园13 A二层 2022"):"Address错误";
////        assert orders.get(0).getPackageInfo().equals("asfa"):"PackageInfo错误";
////        assert orders.get(0).getAmount()==0.99:"Amount错误";
////        assert orders.get(0).getPhone().equals("18935372991"):"Phone错误";
////        assert orders.get(0).getProductId()==1:"订单类型";
////        assert orders.get(0).getOrderStatus()==4:"订单状态";
////    }
////    @Sql({"./order/orders1.sql",
////            "./order/orders_detail1.sql"
////            ,"users1.sql",
////            "./order/coupon.sql",
////            "./order/coupon_book.sql"
////            ,"./order/activity_record1.sql"})
////    @Test
////    //发单
////    public void testDistribute_f1_IsUseDiscount() throws GeneralSecurityException, NotFoundException, IOException, URISyntaxException, HttpCodeException {
////        BaseContext.setCurrentId("oD1dE6WKquXYcBKhX9vL9H90YsLk");
////        OrderDTO orderDTO1=new OrderDTO();
////        orderDTO1.setPhone("18935372991");
////        orderDTO1.setAddress("静园1 一层 101(测试)");
////        LocalDate currentDate = LocalDate.now();
////        int month = currentDate.getMonthValue();
////        String  day = String.valueOf(currentDate.getDayOfMonth());
////        if(Integer.parseInt(day)<10){
////            day="0"+day;
////        }
////        orderDTO1.setExpectTime(month+"-"+day+" 12:00-12:30");
////        orderDTO1.setPackageInfo("衣服 12-4-2345");
////                orderDTO1.setProductId(1);
////
////        //图片
////        //备注
////        orderDTO1.setAmount(0.99);
//////        orderDTO1.setIsUseDiscount(false);
////        //优惠卷
//////        orderDTO.setCouponId();
////        Result submit = orderController.submit(orderDTO1);
////        assert submit.getCode()==0:"使用优惠卷为空";
////        int i = testMapper.selectByOpenidAmount();
////        assert i==1:"条数错误，使用优惠卷为空，应插入失败";
////
////
////        List<Orders> orders = orderMapper.selectOut1("oD1dE6WKquXYcBKhX9vL9H90YsLk");
////        System.out.println(orders);
////
////        assert orders.get(0).getExpectTime().equals(month+"-"+day+" 12:00-12:30"):"ExpectTime错误";
////        assert orders.get(0).getAddress().equals("静园13 A二层 2022"):"Address错误";
////        assert orders.get(0).getPackageInfo().equals("asfa"):"PackageInfo错误";
////        assert orders.get(0).getAmount()==0.99:"Amount错误";
////        assert orders.get(0).getPhone().equals("18935372991"):"Phone错误";
////        assert orders.get(0).getProductId()==1:"订单类型";
////        assert orders.get(0).getOrderStatus()==4:"订单状态";
////    }
////
////    //-------------------------------------发单：金额错误------------------------------
////    @Sql({"./order/orders0.sql",
////            "./order/orders_detail0.sql"
////            ,"users1.sql",
////            "./order/coupon.sql",
////            "./order/coupon_book.sql"
////            ,"./order/activity_record1.sql"})
////    @Test
////    //发单
////    public void testDistribute_f2_first_use1() throws GeneralSecurityException, NotFoundException, IOException, URISyntaxException, HttpCodeException {
////        BaseContext.setCurrentId("oD1dE6RdILU9O-EXNaaOSc4cK2-g");
////        OrderDTO orderDTO1=new OrderDTO();
////        orderDTO1.setPhone("18935372991");
////        orderDTO1.setAddress("静园1 一层 101(测试)");
////        LocalDate currentDate = LocalDate.now();
////        int month = currentDate.getMonthValue();
////        int day = currentDate.getDayOfMonth();
////        orderDTO1.setExpectTime(month+"-"+day+" 12:00-12:30");
////        orderDTO1.setPackageInfo("衣服 12-4-2345");
////        orderDTO1.setProductId(1);
////
////        //图片
////        //备注
////        orderDTO1.setAmount(0.99);
////        orderDTO1.setIsUseDiscount(true);
////        //优惠卷
////        orderDTO1.setCouponId(1);
////        Result submit = orderController.submit(orderDTO1);
////        assert submit.getCode()==0:"使用优惠卷金额错误99";
////
////        int i = testMapper.selectByOpenidAmount();
////        assert i==0:"条数错误，使用优惠卷金额错误99，应插入失败";
////
////
////
////    }
//////    @Sql({"./orders0.sql",
//////            "./orders_detail0.sql"
//////            ,"users1.sql",
//////            "coupon.sql",
//////            "coupon_book.sql"})
//////    @Test
//////    //发单
//////    public void testDistribute_f2_first_use2() throws GeneralSecurityException, NotFoundException, IOException, URISyntaxException, HttpCodeException {
//////        BaseContext.setCurrentId("oD1dE6RdILU9O-EXNaaOSc4cK2-g");
//////        OrderDTO orderDTO1=new OrderDTO();
//////        orderDTO1.setPhone("18935372991");
//////        orderDTO1.setAddress("静园1 一层 101(测试)");
//////        orderDTO1.setExpectTime("12:00-12:30");
//////        orderDTO1.setPackageInfo("衣服 12-4-2345");
//////                    orderDTO1.setProductId(1);
////
//////        //图片
//////        //备注
//////        orderDTO1.setAmount(0.49);
//////        orderDTO1.setIsUseDiscount(true);
//////        //优惠卷
////////        orderDTO1.setCouponId(1);
//////        Result submit = orderController.submit(orderDTO1);
//////        System.out.println(submit);
//////        assert submit.getCode()==0;
//////
//////        int i = testMapper.selectByOpenidAmount();
//////        assert i==0:"条数错误，使用优惠卷但传优惠卷id，应插入失败";
//////    }
////
////    @Sql({"./order/orders0.sql",
////            "./order/orders_detail0.sql"
////            ,"users1.sql",
////            "./order/coupon.sql",
////            "./order/coupon_book.sql"})
////    @Test
////    //发单
////    public void testDistribute_f2_first_use3() throws GeneralSecurityException, NotFoundException, IOException, URISyntaxException, HttpCodeException {
////        BaseContext.setCurrentId("oD1dE6RdILU9O-EXNaaOSc4cK2-g");
////        OrderDTO orderDTO1=new OrderDTO();
////        orderDTO1.setPhone("18935372991");
////        orderDTO1.setAddress("静园1 一层 101(测试)");
////        LocalDate currentDate = LocalDate.now();
////        int month = currentDate.getMonthValue();
////        int day = currentDate.getDayOfMonth();
////        orderDTO1.setExpectTime(month+"-"+day+" 12:00-12:30");
////        orderDTO1.setPackageInfo("衣服 12-4-2345");
////        orderDTO1.setProductId(1);
////
////        //图片
////        //备注
////        orderDTO1.setAmount(0.33);
////        orderDTO1.setIsUseDiscount(true);
////        //优惠卷
//////        orderDTO1.setCouponId(1);
////        Result submit = orderController.submit(orderDTO1);
////        System.out.println(submit);
////        assert submit.getCode()==0:"使用优惠卷金额错误33";
////
////        int i = testMapper.selectByOpenidAmount();
////        assert i==0:"条数错误，使用优惠卷金额错误33，应插入失败";
////    }
////    @Sql({"./order/orders0.sql",
////            "./order/orders_detail0.sql"
////            ,"users1.sql",
////            "./order/coupon.sql",
////            "./order/coupon_book.sql"})
////    @Test
////    //发单
////    public void testDistribute_f2_first_notuse1() throws GeneralSecurityException, NotFoundException, IOException, URISyntaxException, HttpCodeException {
////        BaseContext.setCurrentId("oD1dE6RdILU9O-EXNaaOSc4cK2-g");
////        OrderDTO orderDTO1=new OrderDTO();
////        orderDTO1.setPhone("18935372991");
////        orderDTO1.setAddress("静园1 一层 101(测试)");
////        LocalDate currentDate = LocalDate.now();
////        int month = currentDate.getMonthValue();
////        int day = currentDate.getDayOfMonth();
////        orderDTO1.setExpectTime(month+"-"+day+" 12:00-12:30");
////        orderDTO1.setPackageInfo("衣服 12-4-2345");
////        orderDTO1.setProductId(1);
////
////        //图片
////        //备注
////        orderDTO1.setAmount(0.49);
////        orderDTO1.setIsUseDiscount(false);
////        //优惠卷
//////        orderDTO1.setCouponId(1);
////        Result submit = orderController.submit(orderDTO1);
////        System.out.println(submit);
////        assert submit.getCode()==0:"不使用优惠卷，金额错误全部自动转化为33";
////
////        int i = testMapper.selectByOpenidAmount();
////        assert i==0:"条数错误，不使用优惠卷，金额错误全部自动转化为33，应插入失败";
////
//////        List<Orders> orders = orderMapper.selectOut1("oD1dE6RdILU9O-EXNaaOSc4cK2-g");
//////        System.out.println(orders);
//////        assert orders.get(0).getExpectTime().equals(month+"-"+day+" 12:00-12:30"):"ExpectTime错误";
//////        assert orders.get(0).getAddress().equals("静园1 一层 101(测试)"):"Address错误";
//////        assert orders.get(0).getPackageInfo().equals("衣服 12-4-2345"):"PackageInfo错误";
//////        assert orders.get(0).getAmount()==0.33:"Amount错误";
//////        assert orders.get(0).getPhone().equals("18935372991"):"Phone错误";
//////        assert orders.get(0).getProductId()==1:"订单类型";
//////        assert orders.get(0).getOrderStatus()==1:"订单状态";
////    }
////
////    @Sql({"./order/orders0.sql",
////            "./order/orders_detail0.sql"
////            ,"users1.sql",
////            "./order/coupon.sql",
////            "./order/coupon_book.sql"})
////    @Test
////    //发单
////    public void testDistribute_f2_first_notuse2() throws GeneralSecurityException, NotFoundException, IOException, URISyntaxException, HttpCodeException {
////        BaseContext.setCurrentId("oD1dE6RdILU9O-EXNaaOSc4cK2-g");
////        OrderDTO orderDTO1=new OrderDTO();
////        orderDTO1.setPhone("18935372991");
////        orderDTO1.setAddress("静园1 一层 101(测试)");
////        LocalDate currentDate = LocalDate.now();
////        int month = currentDate.getMonthValue();
////        int day = currentDate.getDayOfMonth();
////        orderDTO1.setExpectTime(month+"-"+day+" 12:00-12:30");
////        orderDTO1.setPackageInfo("衣服 12-4-2345");
////        orderDTO1.setProductId(1);
////
////        //图片
////        //备注
////        orderDTO1.setAmount(0.49);
////        orderDTO1.setIsUseDiscount(false);
////        //优惠卷
//////        orderDTO1.setCouponId(1);
////        Result submit = orderController.submit(orderDTO1);
////        System.out.println(submit);
////        assert submit.getCode()==0:"不使用优惠卷，金额错误全部自动转化为33";
////
////        int i = testMapper.selectByOpenidAmount();
////        assert i==0:"条数错误，金额错误全部自动转化为33，应插入失败";
////
//////        List<Orders> orders = orderMapper.selectOut1("oD1dE6RdILU9O-EXNaaOSc4cK2-g");
//////        System.out.println(orders);
//////        assert orders.get(0).getExpectTime().equals(month+"-"+day+" 12:00-12:30"):"ExpectTime错误";
//////        assert orders.get(0).getAddress().equals("静园1 一层 101(测试)"):"Address错误";
//////        assert orders.get(0).getPackageInfo().equals("衣服 12-4-2345"):"PackageInfo错误";
//////        assert orders.get(0).getAmount()==0.33:"Amount错误";
//////        assert orders.get(0).getPhone().equals("18935372991"):"Phone错误";
//////        assert orders.get(0).getProductId()==1:"订单类型";
//////        assert orders.get(0).getOrderStatus()==1:"订单状态";
////    }
////
////
////    @Sql({"./order/orders1.sql",
////            "./order/orders_detail1.sql"
////            ,"users1.sql",
////            "./order/coupon.sql",
////            "./order/coupon_book.sql"})
////    @Test
////    //发单
////    public void testDistribute_f2_notfirst_use_idnull1() throws GeneralSecurityException, NotFoundException, IOException, URISyntaxException, HttpCodeException {
////        BaseContext.setCurrentId("oD1dE6WKquXYcBKhX9vL9H90YsLk");
////        OrderDTO orderDTO1=new OrderDTO();
////        orderDTO1.setPhone("18935372991");
////        orderDTO1.setAddress("静园1 一层 101(测试)");
////        LocalDate currentDate = LocalDate.now();
////        int month = currentDate.getMonthValue();
////        String  day = String.valueOf(currentDate.getDayOfMonth());
////        if(Integer.parseInt(day)<10){
////            day="0"+day;
////        }
////        orderDTO1.setExpectTime(month+"-"+day+" 12:00-12:30");
////        orderDTO1.setPackageInfo("衣服 12-4-2345");
////        orderDTO1.setProductId(1);
////
////        //图片
////        //备注
////        orderDTO1.setAmount(0.33);
////        orderDTO1.setIsUseDiscount(false);
////        //优惠卷
//////        orderDTO1.setCouponId(1);
////        Result submit = orderController.submit(orderDTO1);
////        System.out.println(submit);
////        assert submit.getCode()==0:"非首单，使用优惠卷,id为空";
////
////        int i = testMapper.selectByOpenidAmount();
////        assert i==1:"条数错误，非首单，使用优惠卷金额错误，应插入失败";
////
////        List<Orders> orders = orderMapper.selectOut1("oD1dE6WKquXYcBKhX9vL9H90YsLk");
////        System.out.println(orders);
////
////        assert orders.get(0).getExpectTime().equals(month+"-"+day+" 12:00-12:30"):"ExpectTime错误";
////        assert orders.get(0).getAddress().equals("静园13 A二层 2022"):"Address错误";
////        assert orders.get(0).getPackageInfo().equals("asfa"):"PackageInfo错误";
////        assert orders.get(0).getAmount()==0.99:"Amount错误";
////        assert orders.get(0).getPhone().equals("18935372991"):"Phone错误";
////        assert orders.get(0).getProductId()==1:"订单类型";
////        assert orders.get(0).getOrderStatus()==4:"订单状态";
////    }
////
////    @Sql({"./order/orders1.sql",
////            "./order/orders_detail1.sql"
////            ,"users1.sql",
////            "./order/coupon.sql",
////            "./order/coupon_book.sql"})
////    @Test
////    //发单
////    public void testDistribute_f2_notfirst_use_idnull2() throws GeneralSecurityException, NotFoundException, IOException, URISyntaxException, HttpCodeException {
////        BaseContext.setCurrentId("oD1dE6WKquXYcBKhX9vL9H90YsLk");
////        OrderDTO orderDTO1=new OrderDTO();
////        orderDTO1.setPhone("18935372991");
////        orderDTO1.setAddress("静园1 一层 101(测试)");
////        LocalDate currentDate = LocalDate.now();
////        int month = currentDate.getMonthValue();
////        String  day = String.valueOf(currentDate.getDayOfMonth());
////        if(Integer.parseInt(day)<10){
////            day="0"+day;
////        }
////        orderDTO1.setExpectTime(month+"-"+day+" 12:00-12:30");
////        orderDTO1.setPackageInfo("衣服 12-4-2345");
////        orderDTO1.setProductId(1);
////
////        //图片
////        //备注
////        orderDTO1.setAmount(0.49);
////        orderDTO1.setIsUseDiscount(false);
////        //优惠卷
//////        orderDTO1.setCouponId(1);
////        Result submit = orderController.submit(orderDTO1);
////        System.out.println(submit);
////        assert submit.getCode()==0:"非首单，使用优惠卷,id为空";
////
////        int i = testMapper.selectByOpenidAmount();
////        assert i==1:"条数错误，不使用优惠卷但传优惠卷id，应插入失败";
////
////        List<Orders> orders = orderMapper.selectOut1("oD1dE6WKquXYcBKhX9vL9H90YsLk");
////        System.out.println(orders);
////
////        assert orders.get(0).getExpectTime().equals(month+"-"+day+" 12:00-12:30"):"ExpectTime错误";
////        assert orders.get(0).getAddress().equals("静园13 A二层 2022"):"Address错误";
////        assert orders.get(0).getPackageInfo().equals("asfa"):"PackageInfo错误";
////        assert orders.get(0).getAmount()==0.99:"Amount错误";
////        assert orders.get(0).getPhone().equals("18935372991"):"Phone错误";
////        assert orders.get(0).getProductId()==1:"订单类型";
////        assert orders.get(0).getOrderStatus()==4:"订单状态";
////    }
//////    @Sql({"./orders1.sql",
//////            "./orders_detail1.sql"
//////            ,"users1.sql",
//////            "coupon.sql",
//////            "coupon_book.sql"})
//////    @Test
//////    //发单
//////    public void testDistribute_f2_notfirst_use_idnull3() throws GeneralSecurityException, NotFoundException, IOException, URISyntaxException, HttpCodeException {
//////        BaseContext.setCurrentId("oD1dE6WKquXYcBKhX9vL9H90YsLk");
//////        OrderDTO orderDTO1=new OrderDTO();
//////        orderDTO1.setPhone("18935372991");
//////        orderDTO1.setAddress("静园1 一层 101(测试)");
//////        orderDTO1.setExpectTime("12:00-12:30");
//////        orderDTO1.setPackageInfo("衣服 12-4-2345");
//////        orderDTO1.setProductId(1);
//////
//////        //图片
//////        //备注
//////        orderDTO1.setAmount(0.99);
//////        orderDTO1.setIsUseDiscount(false);
//////        //优惠卷
////////        orderDTO1.setCouponId(1);
//////        Result submit = orderController.submit(orderDTO1);
//////        System.out.println(submit);
//////        assert submit.getCode()==0;
//////
//////        int i = testMapper.selectByOpenidAmount();
//////        assert i==1:"条数错误，不使用优惠卷但传优惠卷id，应插入失败";
//////    }
////    @Sql({"./order/orders1.sql",
////            "./order/orders_detail1.sql"
////            ,"users1.sql",
////            "./order/coupon.sql",
////            "./order/coupon_book.sql"})
////    @Test
////    //发单
////    public void testDistribute_f2_notfirst_use_id1() throws GeneralSecurityException, NotFoundException, IOException, URISyntaxException, HttpCodeException {
////        BaseContext.setCurrentId("oD1dE6WKquXYcBKhX9vL9H90YsLk");
////        OrderDTO orderDTO1=new OrderDTO();
////        orderDTO1.setPhone("18935372991");
////        orderDTO1.setAddress("静园1 一层 101(测试)");
////        LocalDate currentDate = LocalDate.now();
////        int month = currentDate.getMonthValue();
////        String  day = String.valueOf(currentDate.getDayOfMonth());
////        if(Integer.parseInt(day)<10){
////            day="0"+day;
////        }
////        orderDTO1.setExpectTime(month+"-"+day+" 12:00-12:30");
////        orderDTO1.setPackageInfo("衣服 12-4-2345");
////        orderDTO1.setProductId(1);
////
////        //图片
////        //备注
////        orderDTO1.setAmount(0.99);
////        orderDTO1.setIsUseDiscount(true);
////        //优惠卷
////        orderDTO1.setCouponId(1);
////        Result submit = orderController.submit(orderDTO1);
////        System.out.println(submit);
////        assert submit.getCode()==0:"使用优惠卷金额错误99";
////
////        int i = testMapper.selectByOpenidAmount();
////        assert i==1:"条数错误，使用优惠卷金额错误99，应插入失败";
////
////        List<Orders> orders = orderMapper.selectOut1("oD1dE6WKquXYcBKhX9vL9H90YsLk");
////        System.out.println(orders);
////
////        assert orders.get(0).getExpectTime().equals(month+"-"+day+" 12:00-12:30"):"ExpectTime错误";
////        assert orders.get(0).getAddress().equals("静园13 A二层 2022"):"Address错误";
////        assert orders.get(0).getPackageInfo().equals("asfa"):"PackageInfo错误";
////        assert orders.get(0).getAmount()==0.99:"Amount错误";
////        assert orders.get(0).getPhone().equals("18935372991"):"Phone错误";
////        assert orders.get(0).getProductId()==1:"订单类型";
////        assert orders.get(0).getOrderStatus()==4:"订单状态";
////    }
////    @Sql({"./order/orders1.sql",
////            "./order/orders_detail1.sql"
////            ,"users1.sql",
////            "./order/coupon.sql",
////            "./order/coupon_book.sql"})
////    @Test
////    //发单
////    public void testDistribute_f2_notfirst_use_id2() throws GeneralSecurityException, NotFoundException, IOException, URISyntaxException, HttpCodeException {
////        BaseContext.setCurrentId("oD1dE6WKquXYcBKhX9vL9H90YsLk");
////        OrderDTO orderDTO1=new OrderDTO();
////        orderDTO1.setPhone("18935372991");
////        orderDTO1.setAddress("静园1 一层 101(测试)");
////        LocalDate currentDate = LocalDate.now();
////        int month = currentDate.getMonthValue();
////        String  day = String.valueOf(currentDate.getDayOfMonth());
////        if(Integer.parseInt(day)<10){
////            day="0"+day;
////        }
////        orderDTO1.setExpectTime(month+"-"+day+" 12:00-12:30");
////        orderDTO1.setPackageInfo("衣服 12-4-2345");
////        orderDTO1.setProductId(1);
////
////        //图片
////        //备注
////        orderDTO1.setAmount(0.33);
////        orderDTO1.setIsUseDiscount(false);
////        //优惠卷
////        orderDTO1.setCouponId(1);
////        Result submit = orderController.submit(orderDTO1);
////        System.out.println(submit);
////        assert submit.getCode()==0:"非首单，使用优惠卷金额错误33";
////
////        int i = testMapper.selectByOpenidAmount();
////        assert i==1:"条数错误，非首单，使用优惠卷金额错误33，应插入失败";
////
////        List<Orders> orders = orderMapper.selectOut1("oD1dE6WKquXYcBKhX9vL9H90YsLk");
////        System.out.println(orders);
////
////        assert orders.get(0).getExpectTime().equals(month+"-"+day+" 12:00-12:30"):"ExpectTime错误";
////        assert orders.get(0).getAddress().equals("静园13 A二层 2022"):"Address错误";
////        assert orders.get(0).getPackageInfo().equals("asfa"):"PackageInfo错误";
////        assert orders.get(0).getAmount()==0.99:"Amount错误";
////        assert orders.get(0).getPhone().equals("18935372991"):"Phone错误";
////        assert orders.get(0).getProductId()==1:"订单类型";
////        assert orders.get(0).getOrderStatus()==4:"订单状态";
////    }
////    @Sql({"./order/orders1.sql",
////            "./order/orders_detail1.sql"
////            ,"users1.sql",
////            "./order/coupon.sql",
////            "./order/coupon_book.sql"})
////    @Test
////    //发单
////    public void testDistribute_f2_notfirst_notuse1() throws GeneralSecurityException, NotFoundException, IOException, URISyntaxException, HttpCodeException {
////        LocalDate currentDate = LocalDate.now();
////        int month = currentDate.getMonthValue();
////        String  day = String.valueOf(currentDate.getDayOfMonth());
////        if(Integer.parseInt(day)<10){
////            day="0"+day;
////        }
////
////        BaseContext.setCurrentId("oD1dE6WKquXYcBKhX9vL9H90YsLk");
////        OrderDTO orderDTO1=new OrderDTO();
////        orderDTO1.setPhone("18935372991");
////        orderDTO1.setAddress("静园1 一层 101(测试)");
////        orderDTO1.setExpectTime(month+"-"+day+" 12:00-12:30");
////        orderDTO1.setPackageInfo("衣服 12-4-2345");
////        orderDTO1.setProductId(1);
////
////        //图片
////        //备注
////        orderDTO1.setAmount(0.33);
////        orderDTO1.setIsUseDiscount(false);
////        //优惠卷
////        orderDTO1.setCouponId(1);
////        Result submit = orderController.submit(orderDTO1);
////        System.out.println(submit);
////        assert submit.getCode()==0:"非首单，不使用优惠卷金额错误33";
////
////        int i = testMapper.selectByOpenidAmount();
////        assert i==1:"条数错误，非首单，不使用优惠卷金额错误33，应插入失败";
////
////
////        List<Orders> orders = orderMapper.selectOut1("oD1dE6WKquXYcBKhX9vL9H90YsLk");
////        System.out.println(orders);
////
////        assert orders.get(0).getExpectTime().equals(month+"-"+day+" 12:00-12:30"):"ExpectTime错误";
////        assert orders.get(0).getAddress().equals("静园13 A二层 2022"):"Address错误";
////        assert orders.get(0).getPackageInfo().equals("asfa"):"PackageInfo错误";
////        assert orders.get(0).getAmount()==0.99:"Amount错误";
////        assert orders.get(0).getPhone().equals("18935372991"):"Phone错误";
////        assert orders.get(0).getProductId()==1:"订单类型";
////        assert orders.get(0).getOrderStatus()==4:"订单状态";
////    }
////    @Sql({"./order/orders1.sql",
////            "./order/orders_detail1.sql"
////            ,"users1.sql",
////            "./order/coupon.sql",
////            "./order/coupon_book.sql"})
////    @Test
////    //发单
////    public void testDistribute_f2_notfirst_notuse2() throws GeneralSecurityException, NotFoundException, IOException, URISyntaxException, HttpCodeException {
////        BaseContext.setCurrentId("oD1dE6WKquXYcBKhX9vL9H90YsLk");
////        OrderDTO orderDTO1=new OrderDTO();
////        orderDTO1.setPhone("18935372991");
////        orderDTO1.setAddress("静园1 一层 101(测试)");
////        LocalDate currentDate = LocalDate.now();
////        int month = currentDate.getMonthValue();
////        String  day = String.valueOf(currentDate.getDayOfMonth());
////        if(Integer.parseInt(day)<10){
////            day="0"+day;
////        }
////        orderDTO1.setExpectTime(month+"-"+day+" 12:00-12:30");
////        orderDTO1.setPackageInfo("衣服 12-4-2345");
////        orderDTO1.setProductId(1);
////
////        //图片
////        //备注
////        orderDTO1.setAmount(0.49);
////        orderDTO1.setIsUseDiscount(false);
////        //优惠卷
////        orderDTO1.setCouponId(1);
////        Result submit = orderController.submit(orderDTO1);
////        System.out.println(submit);
////        assert submit.getCode()==0:"非首单，不使用优惠卷金额错误99";
////
////        int i = testMapper.selectByOpenidAmount();
////        assert i==1:"条数错误，非首单，不使用优惠卷金额错误99，应插入失败";
////
////        List<Orders> orders = orderMapper.selectOut1("oD1dE6WKquXYcBKhX9vL9H90YsLk");
////        System.out.println(orders);
////
////        assert orders.get(0).getExpectTime().equals(month+"-"+day+" 12:00-12:30"):"ExpectTime错误";
////        assert orders.get(0).getAddress().equals("静园13 A二层 2022"):"Address错误";
////        assert orders.get(0).getPackageInfo().equals("asfa"):"PackageInfo错误";
////        assert orders.get(0).getAmount()==0.99:"Amount错误";
////        assert orders.get(0).getPhone().equals("18935372991"):"Phone错误";
////        assert orders.get(0).getProductId()==1:"订单类型";
////        assert orders.get(0).getOrderStatus()==4:"订单状态";
////    }
////
////    //-------------------------------------------发单：加急单------------------------------------------------------
////    @Sql({"./order/orders0.sql",
////            "./order/orders_detail0.sql"
////            ,"users1.sql"})
////    @Test
////    //发单
////    public void testDistribute_jiajidan() throws GeneralSecurityException, NotFoundException, IOException, URISyntaxException, HttpCodeException {
////        BaseContext.setCurrentId("oD1dE6RdILU9O-EXNaaOSc4cK2-g");
////        OrderDTO orderDTO1=new OrderDTO();
////        orderDTO1.setPhone("18935372991");
////        orderDTO1.setAddress("静园1 一层 101(测试)");
////        LocalDate currentDate = LocalDate.now();
////        int month = currentDate.getMonthValue();
////        int day = currentDate.getDayOfMonth();
////        orderDTO1.setPackageInfo("衣服 12-4-2345");
////        orderDTO1.setProductId(7);
////        //图片
////        //备注
////        orderDTO1.setAmount(33.0);
////        orderDTO1.setIsUseDiscount(false);
////        //优惠卷
//////        orderDTO.setCouponId();
////        Result submit = orderController.submit(orderDTO1);
////        assert submit.getCode()==1:"发首单";
////        int i = testMapper.selectByOpenidAmount();
////        assert i==1:"条数正确";
////        List<Orders> orders = orderMapper.selectOut1("oD1dE6RdILU9O-EXNaaOSc4cK2-g");
////        System.out.println(orders);
////        assert orders.get(0).getAddress().equals("静园1 一层 101(测试)"):"Address错误";
////        assert orders.get(0).getPackageInfo().equals("衣服 12-4-2345"):"PackageInfo错误";
////        assert orders.get(0).getAmount()==33.0:"Amount错误";
////        assert orders.get(0).getPhone().equals("18935372991"):"Phone错误";
////        assert orders.get(0).getProductId()==7:"订单类型";
////        assert orders.get(0).getOrderStatus()==1:"订单状态";
////
////        Users users = userMapper.selectByOpenId("oD1dE6RdILU9O-EXNaaOSc4cK2-g");
////        assert users.getOrderTimes()==1;
////
////
////
////    }
////
////    @Sql({"./order/orders0.sql",
////            "./order/orders_detail0.sql"
////            ,"users1.sql"})
////    @Test
////    //发单
////    public void testDistribute_jiajidan_f1() throws GeneralSecurityException, NotFoundException, IOException, URISyntaxException, HttpCodeException {
////        BaseContext.setCurrentId("oD1dE6RdILU9O-EXNaaOSc4cK2-g");
////        OrderDTO orderDTO1=new OrderDTO();
//////        orderDTO1.setPhone("18935372991");
////        orderDTO1.setAddress("静园1 一层 101(测试)");
////        LocalDate currentDate = LocalDate.now();
////        int month = currentDate.getMonthValue();
////        int day = currentDate.getDayOfMonth();
////        orderDTO1.setPackageInfo("衣服 12-4-2345");
////        orderDTO1.setProductId(7);
////        //图片
////        //备注
////        orderDTO1.setAmount(33.0);
////        orderDTO1.setIsUseDiscount(false);
////        //优惠卷
//////        orderDTO.setCouponId();
////        Result submit = orderController.submit(orderDTO1);
////        assert submit.getCode()==0:"加急单，电话为空";
////        int i = testMapper.selectByOpenidAmount();
////        assert i==0:"条数正确";
////        List<Orders> orders = orderMapper.selectOut1("oD1dE6RdILU9O-EXNaaOSc4cK2-g");
////        System.out.println(orders);
////
////        Users users = userMapper.selectByOpenId("oD1dE6RdILU9O-EXNaaOSc4cK2-g");
////        assert users.getOrderTimes()==0;
////    }
////
////    @Sql({"./order/orders0.sql",
////            "./order/orders_detail0.sql"
////            ,"users1.sql"})
////    @Test
////    //发单
////    public void testDistribute_jiajidan_f2() throws GeneralSecurityException, NotFoundException, IOException, URISyntaxException, HttpCodeException {
////        BaseContext.setCurrentId("oD1dE6RdILU9O-EXNaaOSc4cK2-g");
////        OrderDTO orderDTO1=new OrderDTO();
////        orderDTO1.setPhone("18935372991");
//////        orderDTO1.setAddress("静园1 一层 101(测试)");
////        LocalDate currentDate = LocalDate.now();
////        int month = currentDate.getMonthValue();
////        int day = currentDate.getDayOfMonth();
////        orderDTO1.setPackageInfo("衣服 12-4-2345");
////        orderDTO1.setProductId(7);
////        //图片
////        //备注
////        orderDTO1.setAmount(33.0);
////        orderDTO1.setIsUseDiscount(false);
////        //优惠卷
//////        orderDTO.setCouponId();
////        Result submit = orderController.submit(orderDTO1);
////        assert submit.getCode()==0:"加急单，地址为空";
////        int i = testMapper.selectByOpenidAmount();
////        assert i==0:"条数正确";
////        List<Orders> orders = orderMapper.selectOut1("oD1dE6RdILU9O-EXNaaOSc4cK2-g");
////        System.out.println(orders);
////
////        Users users = userMapper.selectByOpenId("oD1dE6RdILU9O-EXNaaOSc4cK2-g");
////        assert users.getOrderTimes()==0;
////    }
////
////    @Sql({"./order/orders0.sql",
////            "./order/orders_detail0.sql"
////            ,"users1.sql"})
////    @Test
////    //发单
////    public void testDistribute_jiajidan_f3() throws GeneralSecurityException, NotFoundException, IOException, URISyntaxException, HttpCodeException {
////        BaseContext.setCurrentId("oD1dE6RdILU9O-EXNaaOSc4cK2-g");
////        OrderDTO orderDTO1=new OrderDTO();
////        orderDTO1.setPhone("18935372991");
////        orderDTO1.setAddress("静园1 一层 101(测试)");
////        LocalDate currentDate = LocalDate.now();
////        int month = currentDate.getMonthValue();
////        int day = currentDate.getDayOfMonth();
//////        orderDTO1.setPackageInfo("衣服 12-4-2345");
////        orderDTO1.setProductId(7);
////        //图片
////        //备注
////        orderDTO1.setAmount(33.0);
////        orderDTO1.setIsUseDiscount(false);
////        //优惠卷
//////        orderDTO.setCouponId();
////        Result submit = orderController.submit(orderDTO1);
////        assert submit.getCode()==0:"加急单，信息为空";
////        int i = testMapper.selectByOpenidAmount();
////        assert i==0:"条数正确";
////        List<Orders> orders = orderMapper.selectOut1("oD1dE6RdILU9O-EXNaaOSc4cK2-g");
////        System.out.println(orders);
////
////        Users users = userMapper.selectByOpenId("oD1dE6RdILU9O-EXNaaOSc4cK2-g");
////        assert users.getOrderTimes()==0;
////    }
////
////    @Sql({"./order/orders0.sql",
////            "./order/orders_detail0.sql"
////            ,"users1.sql"})
////    @Test
////    //发单
////    public void testDistribute_jiajidan_f4() throws GeneralSecurityException, NotFoundException, IOException, URISyntaxException, HttpCodeException {
////        BaseContext.setCurrentId("oD1dE6RdILU9O-EXNaaOSc4cK2-g");
////        OrderDTO orderDTO1=new OrderDTO();
////        orderDTO1.setPhone("18935372991");
////        orderDTO1.setAddress("静园1 一层 101(测试)");
////        LocalDate currentDate = LocalDate.now();
////        int month = currentDate.getMonthValue();
////        int day = currentDate.getDayOfMonth();
////        orderDTO1.setPackageInfo("衣服 12-4-2345");
//////        orderDTO1.setProductId(7);
////        //图片
////        //备注
////        orderDTO1.setAmount(33.0);
////        orderDTO1.setIsUseDiscount(false);
////        //优惠卷
//////        orderDTO.setCouponId();
////        Result submit = orderController.submit(orderDTO1);
////        assert submit.getCode()==0:"加急单，订单类型为空";
////        int i = testMapper.selectByOpenidAmount();
////        assert i==0:"条数正确";
////        List<Orders> orders = orderMapper.selectOut1("oD1dE6RdILU9O-EXNaaOSc4cK2-g");
////        System.out.println(orders);
////
////        Users users = userMapper.selectByOpenId("oD1dE6RdILU9O-EXNaaOSc4cK2-g");
////        assert users.getOrderTimes()==0;
////    }
////
////    @Sql({"./order/orders0.sql",
////            "./order/orders_detail0.sql"
////            ,"users1.sql"})
////    @Test
////    //发单
////    public void testDistribute_jiajidan_f5() throws GeneralSecurityException, NotFoundException, IOException, URISyntaxException, HttpCodeException {
////        BaseContext.setCurrentId("oD1dE6RdILU9O-EXNaaOSc4cK2-g");
////        OrderDTO orderDTO1=new OrderDTO();
////        orderDTO1.setPhone("18935372991");
////        orderDTO1.setAddress("静园1 一层 101(测试)");
////        LocalDate currentDate = LocalDate.now();
////        int month = currentDate.getMonthValue();
////        int day = currentDate.getDayOfMonth();
////        orderDTO1.setPackageInfo("衣服 12-4-2345");
////        orderDTO1.setProductId(7);
////        //图片
////        //备注
//////        orderDTO1.setAmount(33.0);
////        orderDTO1.setIsUseDiscount(false);
////        //优惠卷
//////        orderDTO.setCouponId();
////        Result submit = orderController.submit(orderDTO1);
////        assert submit.getCode()==0:"加急单，金额为空";
////        int i = testMapper.selectByOpenidAmount();
////        assert i==0:"条数正确";
////        List<Orders> orders = orderMapper.selectOut1("oD1dE6RdILU9O-EXNaaOSc4cK2-g");
////        System.out.println(orders);
////
////        Users users = userMapper.selectByOpenId("oD1dE6RdILU9O-EXNaaOSc4cK2-g");
////        assert users.getOrderTimes()==0;
////    }
////
////    @Sql({"./order/orders0.sql",
////            "./order/orders_detail0.sql"
////            ,"users1.sql"})
////    @Test
////    //发单
////    public void testDistribute_jiajidan_f6() throws GeneralSecurityException, NotFoundException, IOException, URISyntaxException, HttpCodeException {
////        BaseContext.setCurrentId("oD1dE6RdILU9O-EXNaaOSc4cK2-g");
////        OrderDTO orderDTO1=new OrderDTO();
////        orderDTO1.setPhone("18935372991");
////        orderDTO1.setAddress("静园1 一层 101(测试)");
////        LocalDate currentDate = LocalDate.now();
////        int month = currentDate.getMonthValue();
////        int day = currentDate.getDayOfMonth();
////        orderDTO1.setPackageInfo("衣服 12-4-2345");
////        orderDTO1.setProductId(7);
////        //图片
////        //备注
////        orderDTO1.setAmount(33.0);
//////        orderDTO1.setIsUseDiscount(false);
////        //优惠卷
//////        orderDTO.setCouponId();
////        Result submit = orderController.submit(orderDTO1);
////        assert submit.getCode()==0:"加急单，优惠卷为空";
////        int i = testMapper.selectByOpenidAmount();
////        assert i==0:"条数正确";
////        List<Orders> orders = orderMapper.selectOut1("oD1dE6RdILU9O-EXNaaOSc4cK2-g");
////        System.out.println(orders);
////
////        Users users = userMapper.selectByOpenId("oD1dE6RdILU9O-EXNaaOSc4cK2-g");
////        assert users.getOrderTimes()==0;
////    }
////
////    @Sql({"./order/orders0.sql",
////            "./order/orders_detail0.sql"
////            ,"users1.sql"})
////    @Test
////    //发单
////    public void testDistribute_jiajidan_f7() throws GeneralSecurityException, NotFoundException, IOException, URISyntaxException, HttpCodeException {
////        BaseContext.setCurrentId("oD1dE6RdILU9O-EXNaaOSc4cK2-g");
////        OrderDTO orderDTO1=new OrderDTO();
////        orderDTO1.setPhone("18935372991");
////        orderDTO1.setAddress("静园1 一层 101(测试)");
////        LocalDate currentDate = LocalDate.now();
////        int month = currentDate.getMonthValue();
////        int day = currentDate.getDayOfMonth();
////        orderDTO1.setPackageInfo("衣服 12-4-2345");
////        orderDTO1.setProductId(7);
////        //图片
////        //备注
////        orderDTO1.setAmount(0.99);
////        orderDTO1.setIsUseDiscount(false);
////        //优惠卷
//////        orderDTO.setCouponId();
////        Result submit = orderController.submit(orderDTO1);
////        assert submit.getCode()==0:"加急单，金额小于1元";
////        int i = testMapper.selectByOpenidAmount();
////        assert i==0:"条数正确";
////        List<Orders> orders = orderMapper.selectOut1("oD1dE6RdILU9O-EXNaaOSc4cK2-g");
////        System.out.println(orders);
////
////        Users users = userMapper.selectByOpenId("oD1dE6RdILU9O-EXNaaOSc4cK2-g");
////        assert users.getOrderTimes()==0;
////    }
////
////    @Sql({"./order/orders0.sql",
////            "./order/orders_detail0.sql"
////            ,"users1.sql",
////            "./order/coupon_book.sql"})
////    @Test
////    //发单
////    public void testDistribute_jiajidan_f8() throws GeneralSecurityException, NotFoundException, IOException, URISyntaxException, HttpCodeException {
////        BaseContext.setCurrentId("oD1dE6RdILU9O-EXNaaOSc4cK2-g");
////        OrderDTO orderDTO1=new OrderDTO();
////        orderDTO1.setPhone("18935372991");
////        orderDTO1.setAddress("静园1 一层 101(测试)");
////        LocalDate currentDate = LocalDate.now();
////        int month = currentDate.getMonthValue();
////        int day = currentDate.getDayOfMonth();
////        orderDTO1.setPackageInfo("衣服 12-4-2345");
////        orderDTO1.setProductId(7);
////        //图片
////        //备注
////        orderDTO1.setAmount(1.5);
////        orderDTO1.setIsUseDiscount(true);
////        //优惠卷
////        orderDTO1.setCouponId(1);
////        Result submit = orderController.submit(orderDTO1);
////        assert submit.getCode()==0:"加急单，使用优惠卷";
////        int i = testMapper.selectByOpenidAmount();
////        assert i==0:"条数正确";
////        List<Orders> orders = orderMapper.selectOut1("oD1dE6RdILU9O-EXNaaOSc4cK2-g");
////        System.out.println(orders);
////
////        Users users = userMapper.selectByOpenId("oD1dE6RdILU9O-EXNaaOSc4cK2-g");
////        assert users.getOrderTimes()==0;
////
////        CouponBook couponBook = couponBookMapper.selectByOpenid111("oD1dE6RdILU9O-EXNaaOSc4cK2-g", 1);
////        assert couponBook.getCount()==3:"优惠卷数量";
////
////    }
////
////
////
////    //----------------------------------------订单展示模块-------------------------------------
////    @Sql({"./order/getOrderList.sql",
////            "./order/cancle_take_orders1.sql",
////            "./order/address_book1.sql",})
////    @Test
////        //返回所有已发和已结订单
////        public void testHistoryOrders(){
////            BaseContext.setCurrentId("oD1dE6RdILU9O-EXNaaOSc4cK2-g");
////            Result<HistoryOrderVO> historyOrderVOResult = orderController.historyOrders();
////
////            System.out.println(historyOrderVOResult);
////            assert historyOrderVOResult.getCode()==1;
////            assert historyOrderVOResult.getData().getOutOrderList().size()==2;
////            assert historyOrderVOResult.getData().getTakeOrderList().size()==1;
////
////
////
////        }
////
////
////
////    //-------------------------------------取消订单------------------------------
////    @Sql({"./order/cancle.sql"
////            , "./order/cancle_take_orders1.sql"
////    ,"./order/users-cancle.sql"})
////        @Test
////        //取消订单正确取消
////        public void testCancel1() throws GeneralSecurityException, NotFoundException, IOException, URISyntaxException, HttpCodeException {
////            BaseContext.setCurrentId("oD1dE6RdILU9O-EXNaaOSc4cK2-g");
////            Result cancel = orderController.cancel(3);
////            System.out.println(cancel);
////            assert cancel.getCode()==1:cancel.getMsg()+"正确取消";
////
////
////        List<Orders> orders = testMapper.selectAllOrders();
////
////        System.out.println(orders);
////        assert  orders.get(0).getOrderStatus()==5:"状态修改";
////        assert  orders.get(0).getAmount()==0.99:"金额不变";
////
////        assert  orders.get(1).getOrderStatus()==2:"状态修改";
////        assert  orders.get(1).getAmount()==0.99:"金额不变";
////
////        assert  orders.get(2).getOrderStatus()==0:"状态为0";
////        assert  orders.get(2).getAmount()==0.99:"金额不变";
////        }
////    @Sql({"./order/cancle.sql"
////            , "./order/cancle_take_orders1.sql","./order/users-cancle.sql"})
////    @Test
////    //取消订单，状态错误
////    public void testCancel2() throws GeneralSecurityException, NotFoundException, IOException, URISyntaxException, HttpCodeException {
////        BaseContext.setCurrentId("oD1dE6RdILU9O-EXNaaOSc4cK2-g");
////        Result cancel = orderController.cancel(2);
////        System.out.println(cancel);
////        assert cancel.getCode()==0:cancel.getMsg()+"状态码错误";
////
////        List<Orders> orders = testMapper.selectAllOrders();
////
////        System.out.println(orders);
////        assert  orders.get(0).getOrderStatus()==5:"状态修改";
////        assert  orders.get(0).getAmount()==0.99:"金额不变";
////
////        assert  orders.get(1).getOrderStatus()==2:"状态修改";
////        assert  orders.get(1).getAmount()==0.99:"金额不变";
////
////        assert  orders.get(2).getOrderStatus()==1:"状态修改";
////        assert  orders.get(2).getAmount()==0.99:"金额不变";
////    }
//    @Sql({"./order/cancle.sql"
//            , "./order/cancle_take_orders1.sql","./order/users-cancle.sql"})
//    @Test
//    //取消订单，openid错误
//    public void testCancel3() throws GeneralSecurityException, NotFoundException, IOException, URISyntaxException, HttpCodeException {
//        BaseContext.setCurrentId("oD1dE6WKquXYcBKhX9vL9H90YsLk");
//        Result cancel = orderController.cancel(3);
//        System.out.println(cancel);
//        assert cancel.getCode()==0:cancel.getMsg()+"取消别人的订单";
//
//
//        List<Orders> orders = testMapper.selectAllOrders();
//
//        System.out.println(orders);
//        assert  orders.get(0).getOrderStatus()==5:"状态修改";
//        assert  orders.get(0).getAmount()==0.99:"金额不变";
//
//        assert  orders.get(1).getOrderStatus()==2:"状态修改";
//        assert  orders.get(1).getAmount()==0.99:"金额不变";
//
//        assert  orders.get(2).getOrderStatus()==1:"状态修改";
//        assert  orders.get(2).getAmount()==0.99:"金额不变";
//    }
//        //--------------------------------已取件-----------------------------------
//        @Sql({"./order/take_order.sql"
//                , "./order/take_takeorders0.sql","./order/users-cancle.sql"})
//        @Test
//        //正确取件
//        public void testTake1() throws GeneralSecurityException, NotFoundException, IOException, URISyntaxException, HttpCodeException {
//            BaseContext.setCurrentId("oD1dE6WKquXYcBKhX9vL9H90YsLk");
//            Result take = orderController.take(2);
//            assert take.getCode()==1;
//
//            int i = testMapper.selectByOrderSStatus(3);
//            assert i==2:"取件错误";
//
//            List<Orders> orders = testMapper.selectAllOrders();
//
//            System.out.println(orders);
//            assert  orders.get(0).getOrderStatus()==5:"状态修改";
//            assert  orders.get(0).getAmount()==0.99:"金额不变";
//
//            assert  orders.get(1).getOrderStatus()==3:"状态修改成功";
//            assert  orders.get(1).getAmount()==0.99:"金额不变";
//
//            assert  orders.get(2).getOrderStatus()==1:"状态修改";
//            assert  orders.get(2).getAmount()==0.99:"金额不变";
//
//            assert  orders.get(3).getOrderStatus()==3:"状态修改";
//            assert  orders.get(3).getAmount()==0.99:"金额不变";
//
//            assert  orders.get(4).getOrderStatus()==4:"状态修改";
//            assert  orders.get(4).getAmount()==0.99:"金额不变";
//        }
//    @Sql({"./order/take_order.sql"
//            , "./order/take_takeorders0.sql","./order/users-cancle.sql"})
//    @Test
//    //openid错误
//    public void testTake2() throws GeneralSecurityException, NotFoundException, IOException, URISyntaxException, HttpCodeException {
//        BaseContext.setCurrentId("oD1dE6RUZvrdNB3me_JxQnwcEyO4");
//        Result take = orderController.take(2);
//        assert take.getCode()==0;
//
//        List<Orders> orders = testMapper.selectAllOrders();
//
//        System.out.println(orders);
//        assert  orders.get(0).getOrderStatus()==5:"状态修改";
//        assert  orders.get(0).getAmount()==0.99:"金额不变";
//
//        assert  orders.get(1).getOrderStatus()==2:"状态修改";
//        assert  orders.get(1).getAmount()==0.99:"金额不变";
//
//        assert  orders.get(2).getOrderStatus()==1:"状态修改";
//        assert  orders.get(2).getAmount()==0.99:"金额不变";
//
//        assert  orders.get(3).getOrderStatus()==3:"状态修改";
//        assert  orders.get(3).getAmount()==0.99:"金额不变";
//
//        assert  orders.get(4).getOrderStatus()==4:"状态修改";
//        assert  orders.get(4).getAmount()==0.99:"金额不变";
//    }
//    @Sql({"./order/take_order.sql"
//            , "./order/take_takeorders0.sql","./order/users-cancle.sql"})
//    @Test
//    //状态错误
//    public void testTake3() throws GeneralSecurityException, NotFoundException, IOException, URISyntaxException, HttpCodeException {
//        BaseContext.setCurrentId("oD1dE6WKquXYcBKhX9vL9H90YsLk");
//        Result take = orderController.take(5);
//        System.out.println(take);
//        assert take.getCode()==0;
//
//        List<Orders> orders = testMapper.selectAllOrders();
//
//        System.out.println(orders);
//        assert  orders.get(0).getOrderStatus()==5:"状态修改";
//        assert  orders.get(0).getAmount()==0.99:"金额不变";
//
//        assert  orders.get(1).getOrderStatus()==2:"状态修改";
//        assert  orders.get(1).getAmount()==0.99:"金额不变";
//
//        assert  orders.get(2).getOrderStatus()==1:"状态修改";
//        assert  orders.get(2).getAmount()==0.99:"金额不变";
//
//        assert  orders.get(3).getOrderStatus()==3:"状态修改";
//        assert  orders.get(3).getAmount()==0.99:"金额不变";
//
//        assert  orders.get(4).getOrderStatus()==4:"状态修改";
//        assert  orders.get(4).getAmount()==0.99:"金额不变";
//    }
//    @Sql({"./order/take_order.sql"
//            , "./order/take_takeorders0.sql","./order/users-cancle.sql"})
//    @Test
//    //订单id错误
//    public void testTake4() throws GeneralSecurityException, NotFoundException, IOException, URISyntaxException, HttpCodeException {
//        BaseContext.setCurrentId("oD1dE6WKquXYcBKhX9vL9H90YsLk");
//        Result take = orderController.take(100);
//        assert take.getCode()==0;
//
//        List<Orders> orders = testMapper.selectAllOrders();
//
//        System.out.println(orders);
//        assert  orders.get(0).getOrderStatus()==5:"状态修改";
//        assert  orders.get(0).getAmount()==0.99:"金额不变";
//
//        assert  orders.get(1).getOrderStatus()==2:"状态修改";
//        assert  orders.get(1).getAmount()==0.99:"金额不变";
//
//        assert  orders.get(2).getOrderStatus()==1:"状态修改";
//        assert  orders.get(2).getAmount()==0.99:"金额不变";
//
//        assert  orders.get(3).getOrderStatus()==3:"状态修改";
//        assert  orders.get(3).getAmount()==0.99:"金额不变";
//
//        assert  orders.get(4).getOrderStatus()==4:"状态修改";
//        assert  orders.get(4).getAmount()==0.99:"金额不变";
//    }
//    //--------------------------------已送达-----------------------------------
//    @Sql({"./order/take_order.sql"
//            , "./order/take_takeorders0.sql","./order/users-cancle.sql"})
//    @Test
//    //正确送达
//    public void testArrice1() throws GeneralSecurityException, NotFoundException, IOException, URISyntaxException, HttpCodeException {
//        BaseContext.setCurrentId("oD1dE6WKquXYcBKhX9vL9H90YsLk");
//        Result arrive = orderController.arrive(4);
//        assert arrive.getCode()==1;
//        int i = testMapper.selectByOrderSStatus(4);
//        assert i==2:"送达错误";
//
//
//        List<Orders> orders = testMapper.selectAllOrders();
//
//        System.out.println(orders);
//        assert  orders.get(0).getOrderStatus()==5:"状态修改";
//        assert  orders.get(0).getAmount()==0.99:"金额不变";
//
//        assert  orders.get(1).getOrderStatus()==2:"状态修改";
//        assert  orders.get(1).getAmount()==0.99:"金额不变";
//
//        assert  orders.get(2).getOrderStatus()==1:"状态修改";
//        assert  orders.get(2).getAmount()==0.99:"金额不变";
//
//        assert  orders.get(3).getOrderStatus()==4:"状态修改成功";
//        assert  orders.get(3).getAmount()==0.99:"金额不变";
//
//        assert  orders.get(4).getOrderStatus()==4:"状态修改";
//        assert  orders.get(4).getAmount()==0.99:"金额不变";
//    }
//
//    @Sql({"./order/take_order.sql"
//            , "./order/take_takeorders0.sql","./order/users-cancle.sql"})
//    @Test
//    //状态错误
//    public void testArrice2() throws GeneralSecurityException, NotFoundException, IOException, URISyntaxException, HttpCodeException {
//        BaseContext.setCurrentId("oD1dE6WKquXYcBKhX9vL9H90YsLk");
//        Result arrive = orderController.arrive(3);
//        assert arrive.getCode()==0;
//
//        List<Orders> orders = testMapper.selectAllOrders();
//
//        System.out.println(orders);
//        assert  orders.get(0).getOrderStatus()==5:"状态修改";
//        assert  orders.get(0).getAmount()==0.99:"金额不变";
//
//        assert  orders.get(1).getOrderStatus()==2:"状态修改";
//        assert  orders.get(1).getAmount()==0.99:"金额不变";
//
//        assert  orders.get(2).getOrderStatus()==1:"状态修改";
//        assert  orders.get(2).getAmount()==0.99:"金额不变";
//
//        assert  orders.get(3).getOrderStatus()==3:"状态修改";
//        assert  orders.get(3).getAmount()==0.99:"金额不变";
//
//        assert  orders.get(4).getOrderStatus()==4:"状态修改";
//        assert  orders.get(4).getAmount()==0.99:"金额不变";
//    }
//    @Sql({"./order/take_order.sql"
//            , "./order/take_takeorders0.sql","./order/users-cancle.sql"})
//    @Test
//    //openid错误
//    public void testArrice3() throws GeneralSecurityException, NotFoundException, IOException, URISyntaxException, HttpCodeException {
//        BaseContext.setCurrentId("oD1dE6RUZvrdNB3me_JxQnwcEyO4");
//        Result arrive = orderController.arrive(3);
//        assert arrive.getCode()==0;
//
//        List<Orders> orders = testMapper.selectAllOrders();
//
//        System.out.println(orders);
//        assert  orders.get(0).getOrderStatus()==5:"状态修改";
//        assert  orders.get(0).getAmount()==0.99:"金额不变";
//
//        assert  orders.get(1).getOrderStatus()==2:"状态修改";
//        assert  orders.get(1).getAmount()==0.99:"金额不变";
//
//        assert  orders.get(2).getOrderStatus()==1:"状态修改";
//        assert  orders.get(2).getAmount()==0.99:"金额不变";
//
//        assert  orders.get(3).getOrderStatus()==3:"状态修改";
//        assert  orders.get(3).getAmount()==0.99:"金额不变";
//
//        assert  orders.get(4).getOrderStatus()==4:"状态修改";
//        assert  orders.get(4).getAmount()==0.99:"金额不变";
//    }
//    @Sql({"./order/take_order.sql"
//            , "./order/take_takeorders0.sql","./order/users-cancle.sql"})
//    @Test
//    //订单id错误
//    public void testArrice4() throws GeneralSecurityException, NotFoundException, IOException, URISyntaxException, HttpCodeException {
//        BaseContext.setCurrentId("oD1dE6WKquXYcBKhX9vL9H90YsLk");
//        Result arrive = orderController.arrive(1231);
//        assert arrive.getCode()==0;
//
//        List<Orders> orders = testMapper.selectAllOrders();
//
//        System.out.println(orders);
//        assert  orders.get(0).getOrderStatus()==5:"状态修改";
//        assert  orders.get(0).getAmount()==0.99:"金额不变";
//
//        assert  orders.get(1).getOrderStatus()==2:"状态修改";
//        assert  orders.get(1).getAmount()==0.99:"金额不变";
//
//        assert  orders.get(2).getOrderStatus()==1:"状态修改";
//        assert  orders.get(2).getAmount()==0.99:"金额不变";
//
//        assert  orders.get(3).getOrderStatus()==3:"状态修改";
//        assert  orders.get(3).getAmount()==0.99:"金额不变";
//
//        assert  orders.get(4).getOrderStatus()==4:"状态修改";
//        assert  orders.get(4).getAmount()==0.99:"金额不变";
//    }
//    //--------------------------------已确认-----------------------------------
//    @Sql({"./order/take_order.sql"
//            , "./order/take_takeorders0.sql","./order/users-cancle.sql"})
//    @Test
//    //正确确认
//    public void testConfirm1() throws GeneralSecurityException, NotFoundException, IOException, URISyntaxException, HttpCodeException {
//        BaseContext.setCurrentId("oD1dE6RdILU9O-EXNaaOSc4cK2-g");
//        Result confirm = orderController.confirm(5);
//        assert confirm.getCode()==1;
//        int i = testMapper.selectByOrderSStatus(5);
//        assert i==2:"确认错误";
//
//        List<Orders> orders = testMapper.selectAllOrders();
//
//        System.out.println(orders);
//        assert  orders.get(0).getOrderStatus()==5:"状态修改";
//        assert  orders.get(0).getAmount()==0.99:"金额不变";
//
//        assert  orders.get(1).getOrderStatus()==2:"状态修改";
//        assert  orders.get(1).getAmount()==0.99:"金额不变";
//
//        assert  orders.get(2).getOrderStatus()==1:"状态修改";
//        assert  orders.get(2).getAmount()==0.99:"金额不变";
//
//        assert  orders.get(3).getOrderStatus()==3:"状态修改";
//        assert  orders.get(3).getAmount()==0.99:"金额不变";
//
//        assert  orders.get(4).getOrderStatus()==5:"状态修改";
//        assert  orders.get(4).getAmount()==0.99:"金额不变";
//    }
//    @Sql({"./order/take_order.sql"
//            , "./order/take_takeorders0.sql","./order/users-cancle.sql"})
//    @Test
//    //状态错误
//    public void testConfirm2() throws GeneralSecurityException, NotFoundException, IOException, URISyntaxException, HttpCodeException {
//        BaseContext.setCurrentId("oD1dE6RdILU9O-EXNaaOSc4cK2-g");
//        Result confirm = orderController.confirm(4);
//        assert confirm.getCode()==0:"状态判断";
//
//        List<Orders> orders = testMapper.selectAllOrders();
//
//        System.out.println(orders);
//        assert  orders.get(0).getOrderStatus()==5:"状态修改";
//        assert  orders.get(0).getAmount()==0.99:"金额不变";
//
//        assert  orders.get(1).getOrderStatus()==2:"状态修改";
//        assert  orders.get(1).getAmount()==0.99:"金额不变";
//
//        assert  orders.get(2).getOrderStatus()==1:"状态修改";
//        assert  orders.get(2).getAmount()==0.99:"金额不变";
//
//        assert  orders.get(3).getOrderStatus()==3:"状态修改";
//        assert  orders.get(3).getAmount()==0.99:"金额不变";
//
//        assert  orders.get(4).getOrderStatus()==4:"状态修改";
//        assert  orders.get(4).getAmount()==0.99:"金额不变";
//    }
//    @Sql({"./order/take_order.sql"
//            , "./order/take_takeorders0.sql","./order/users-cancle.sql"})
//    @Test
//    //openid错误
//    public void testConfirm3() throws GeneralSecurityException, NotFoundException, IOException, URISyntaxException, HttpCodeException {
//        BaseContext.setCurrentId("oD1dE6RUZvrdNB3me_JxQnwcEyO4");
//        Result confirm = orderController.confirm(5);
//        assert confirm.getCode()==0:"openid错误";
//
//        List<Orders> orders = testMapper.selectAllOrders();
//
//        System.out.println(orders);
//        assert  orders.get(0).getOrderStatus()==5:"状态修改";
//        assert  orders.get(0).getAmount()==0.99:"金额不变";
//
//        assert  orders.get(1).getOrderStatus()==2:"状态修改";
//        assert  orders.get(1).getAmount()==0.99:"金额不变";
//
//        assert  orders.get(2).getOrderStatus()==1:"状态修改";
//        assert  orders.get(2).getAmount()==0.99:"金额不变";
//
//        assert  orders.get(3).getOrderStatus()==3:"状态修改";
//        assert  orders.get(3).getAmount()==0.99:"金额不变";
//
//        assert  orders.get(4).getOrderStatus()==4:"状态修改";
//        assert  orders.get(4).getAmount()==0.99:"金额不变";
//    }
//    @Sql({"./order/take_order.sql"
//            , "./order/take_takeorders0.sql","./order/users-cancle.sql"})
//    @Test
//    //id错误
//    public void testConfirm4() throws GeneralSecurityException, NotFoundException, IOException, URISyntaxException, HttpCodeException {
//        BaseContext.setCurrentId("oD1dE6RdILU9O-EXNaaOSc4cK2-g");
//        Result confirm = orderController.confirm(100);
//        assert confirm.getCode()==0:"id错误";
//
//        List<Orders> orders = testMapper.selectAllOrders();
//
//        System.out.println(orders);
//        assert  orders.get(0).getOrderStatus()==5:"状态修改";
//        assert  orders.get(0).getAmount()==0.99:"金额不变";
//
//        assert  orders.get(1).getOrderStatus()==2:"状态修改";
//        assert  orders.get(1).getAmount()==0.99:"金额不变";
//
//        assert  orders.get(2).getOrderStatus()==1:"状态修改";
//        assert  orders.get(2).getAmount()==0.99:"金额不变";
//
//        assert  orders.get(3).getOrderStatus()==3:"状态修改";
//        assert  orders.get(3).getAmount()==0.99:"金额不变";
//
//        assert  orders.get(4).getOrderStatus()==4:"状态修改";
//        assert  orders.get(4).getAmount()==0.99:"金额不变";
//    }
//    //-----------------------------------------------查询地址---------------------------
//
//    @Sql({
//            "users1.sql","./address_book0.sql",
//            "address_Insert.sql"})
//    @Test
//    public void address_testGetInfo()  {
//        BaseContext.setCurrentId("oD1dE6Ymphob6mNoG3Q6TA33pTkM");
//        Result<AddressInfoVO> info = addressController.getInfo();
//        assert info.getCode()==1;
//        assert info.getData().getAddressList().size()==40;
//    }
//
//    //-----------------------------新增地址---------------------------
//
//    @Sql({"users1.sql","address_book0.sql"})
//    //正确插入数据
//    @Test
//    public void address_testInsert_success() {
//        BaseContext.setCurrentId("oD1dE6WKquXYcBKhX9vL9H90YsLk");
//        SaveAddressDTO saveAddressDTO = new SaveAddressDTO("oD1dE6WKquXYcBKhX9vL9H90YsLk", "静园/静园1A/2楼/201", "18935372991");
//        Result result = addressController.saveAddress(saveAddressDTO);
//        System.out.println(result);
//        assert result.getCode() == 1;
//        List<AddressBook> addressBooks = testMapper.selectAddressBook();
//        //保证数据库有该数据
//        assert addressBooks.get(0).getAddress().equals("静园/静园1A/2楼/201")&&
//                addressBooks.get(0).getPhone().equals("18935372991")&&
//                addressBooks.get(0).getOpenid().equals("oD1dE6WKquXYcBKhX9vL9H90YsLk");
//    }
//
//    @Sql({"users1.sql","address_book0.sql"})
//    //新增时openid错误
//    @Test
//    public void address_testInsert_openid() {
//        BaseContext.setCurrentId("oDLk");
//        SaveAddressDTO saveAddressDTO = new SaveAddressDTO("oDLk", "静园/静园1A/2楼/201", "18935372991");
//        Result result = addressController.saveAddress(saveAddressDTO);
//        System.out.println(result);
//        assert result.getCode() == 0;
//        List<AddressBook> addressBooks = testMapper.selectAddressBook();
//        //保证数据库无该数据
//        assert addressBooks.size()==0;
//    }
//
//
//    @Sql({"users1.sql","address_book0.sql"})
//    //手机号空或错误
//    @Test
//    public void address_testInsert_phone() {
//        BaseContext.setCurrentId("oD1dE6WKquXYcBKhX9vL9H90YsLk");
//        SaveAddressDTO saveAddressDTO3 = new SaveAddressDTO("dwdas", "静园/静园1A/2楼/201", "908690");
//        SaveAddressDTO saveAddressDTO4 = new SaveAddressDTO("dwdas", "静园/静园1A/2楼/201", "");
//        Result result3 = addressController.saveAddress(saveAddressDTO3);
//        Result result4 = addressController.saveAddress(saveAddressDTO4);
//        System.out.println(result3);
//        System.out.println(result4);
//        assert result3.getCode() == 0;
//        assert result4.getCode() == 0;
//        List<AddressBook> addressBooks3 = testMapper.selectAddressBook();
//        List<AddressBook> addressBooks4 = testMapper.selectAddressBook();
//        //保证数据库无此数据
//        assert addressBooks3.size() == 0;
//        assert addressBooks4.size() == 0;
//    }
//
//    @Sql({"users1.sql","address_book0.sql"})
//    //address或phone为null
//    @Test
//    public void address_testInsert_null() {
//        BaseContext.setCurrentId("oD1dE6WKquXYcBKhX9vL9H90YsLk");
//
//        SaveAddressDTO saveAddressDTO7 = new SaveAddressDTO();
//        saveAddressDTO7.setOpenid("oD1dE6WKquXYcBKhX9vL9H90YsLk");
//        saveAddressDTO7.setPhone("18935372991");
//        SaveAddressDTO saveAddressDTO8 = new SaveAddressDTO();
//        saveAddressDTO8.setAddress("静园/静园1A/2楼/201");
//        saveAddressDTO8.setOpenid("oD1dE6WKquXYcBKhX9vL9H90YsLk");
//
//
//        Result result7 = addressController.saveAddress(saveAddressDTO7);
//        Result result8 = addressController.saveAddress(saveAddressDTO8);
//
//        System.out.println(result7);
//        System.out.println(result8);
//
//
//        assert result7.getCode() == 0;
//        assert result8.getCode() == 0;
//
//        List<AddressBook> addressBooks7 = testMapper.selectAddressBook();
//        List<AddressBook> addressBooks8 = testMapper.selectAddressBook();
//        //保证数据库无此数据
//
//        assert addressBooks7.size() == 0;
//        assert addressBooks8.size() == 0;
//    }
//
//    //---------------------------------------修改地址------------------------------
//
//    @Sql({"users1.sql","address_book0.sql",
//            "address_InsertOne.sql"})
//    @Test
//    //正常情况
//    public void address_testsaveInfo_sussess() {
//        BaseContext.setCurrentId("oD1dE6WKquXYcBKhX9vL9H90YsLk");
//
//        EditAddressDTO editAddressDTO = new EditAddressDTO();
//        editAddressDTO.setAddress("静园/静园1A/2楼/666666");
//        editAddressDTO.setId(999999998);
//        editAddressDTO.setPhone("19582082411");
//        Result result = addressController.editAddress(editAddressDTO);
//        assert result.getCode() == 1;
//        List<AddressBook> addressBooks = testMapper.selectAddressBook();
//        assert addressBooks.get(0).getAddress().equals("静园/静园1A/2楼/666666") &&
//                addressBooks.get(0).getIsDefault() == 1&&
//                addressBooks.get(0).getId()==999999998&&
//                addressBooks.get(0).getPhone().equals("19582082411");
//    }
//
//    @Sql({"users1.sql","address_book0.sql",
//            "address_InsertOne.sql"})
//    @Test
//    //编辑地址的openid错误
//    public void address_testsaveInfo_openid() {
//        BaseContext.setCurrentId("oD1k");
//        EditAddressDTO editAddressDTO = new EditAddressDTO();
//        editAddressDTO.setAddress("静园/静园1A/2楼/666666");
//        editAddressDTO.setId(999999998);
//        editAddressDTO.setPhone("19582082411");
//        Result result = addressController.editAddress(editAddressDTO);
//        assert result.getCode() == 0;
//
//        List<AddressBook> addressBooks = testMapper.selectAddressBook();
//        //没有修改原数据
//        assert !addressBooks.get(0).getAddress().equals("静园/静园1A/2楼/666666") &&
//                addressBooks.get(0).getAddress().equals("静园/静园1A/2楼/201");
//    }
//
//    @Sql({"users1.sql","address_book0.sql",
//            "address_InsertOne.sql"})
//    @Test
//    //编辑地址的id错误或为null
//    public void address_testsaveInfo_id() {
//        BaseContext.setCurrentId("oD1dE6WKquXYcBKhX9vL9H90YsLk");
//
//        EditAddressDTO editAddressDTO2 = new EditAddressDTO();
//        editAddressDTO2.setAddress("静园/静园1A/2楼/666667");
//        editAddressDTO2.setId(-1);
//        editAddressDTO2.setPhone("18935372991");
//
//        EditAddressDTO editAddressDTO3 = new EditAddressDTO();
//        editAddressDTO3.setAddress("静园/静园1A/2楼/666667");
//        editAddressDTO3.setPhone("18935372991");
//
//        Result result2 = addressController.editAddress(editAddressDTO2);
//        Result result3 = addressController.editAddress(editAddressDTO3);
//
//        assert result2.getCode() == 0;
//        assert result3.getCode() == 0;
//        List<AddressBook> addressBooks2 = testMapper.selectAddressBook();
//        List<AddressBook> addressBooks3 = testMapper.selectAddressBook();
//        assert !(addressBooks2.get(0).getAddress().equals("静园/静园1A/2楼/666667")
//                &&addressBooks2.get(0).getAddress().equals("静园/静园1A/2楼/201"));
//
//        assert !(addressBooks3.get(0).getAddress().equals("静园/静园1A/2楼/666667")
//                &&addressBooks3.get(0).getAddress().equals("静园/静园1A/2楼/201"));
//    }
//
//    @Sql({"users1.sql","address_book0.sql",
//            "address_InsertOne.sql"})
//    @Test
//    //编辑地址的电话错误或为null
//    public void address_testsaveInfo_phone() {
//        BaseContext.setCurrentId("oD1dE6WKquXYcBKhX9vL9H90YsLk");
//
//        EditAddressDTO editAddressDTO4 = new EditAddressDTO(999999999, "静园/静园1A/2楼/666668", "2817323");
//        EditAddressDTO editAddressDTO5 = new EditAddressDTO();
//        editAddressDTO5.setAddress("静园/静园1A/2楼/666668");
//        editAddressDTO5.setId(999999999);
//        Result result4 = addressController.editAddress(editAddressDTO4);
//        Result result5 = addressController.editAddress(editAddressDTO5);
//        assert result4.getCode() == 0;
//        assert result5.getCode() == 0;
//
//        //确定没有修改
//        List<AddressBook> addressBooks4 = testMapper.selectAddressBook();
//        List<AddressBook> addressBooks5 = testMapper.selectAddressBook();
//        assert !(addressBooks4.get(0).getAddress().equals("静园/静园1A/2楼/666668"))
//        &&(addressBooks4.get(0).getAddress().equals("静园/静园1A/2楼/201"));
//        assert !(addressBooks5.get(0).getAddress().equals("静园/静园1A/2楼/666668"))
//                &&(addressBooks5.get(0).getAddress().equals("静园/静园1A/2楼/201"));
//    }
//
//
//    @Sql({"users1.sql","address_book0.sql",
//            "address_InsertOne.sql"})
//    //修改后的地址已经存在了
//    @Test
//    public void address_testsaveInfo_cunzai(){
//        BaseContext.setCurrentId("oD1dE6WKquXYcBKhX9vL9H90YsLk");
//        EditAddressDTO editAddressDTO6=new EditAddressDTO(999999998,"静园/静园1A/2楼/202","18935372991");
//        Result result6 = addressController.editAddress(editAddressDTO6);
//        assert result6.getCode()==1;
//        //查询这个人所有地址
//        List<AddressBook> addressBooks1 = testMapper.selectAddressBook();
//        assert addressBooks1.size()==1;
//        assert addressBooks1.get(0).getIsDefault()==1&&
//                addressBooks1.get(0).getAddress().equals("静园/静园1A/2楼/202")&&
//                addressBooks1.get(0).getPhone().equals("18935372991");
//    }
//
//
//    //-----------------------------------------------切换默认地址---------------------------
//
//    @Sql({"users1.sql","address_book0.sql",
//            "address_InsertOne.sql"})
//    //正常情况（非默认改默认）（默认改默认）
//    @Test
//    public void address_testUpdate_success() {
//        BaseContext.setCurrentId("oD1dE6WKquXYcBKhX9vL9H90YsLk");
//        //（非默认改默认）
//        Result result = addressController.updateDefaultAddress(999999998);
//        assert result.getCode() == 1;
//
//        //判断数据库内是否修改成功
//        int flag = 0;  //默认地址的个数
//        List<AddressBook> addressBooks = testMapper.selectAddressBook();
//        for (AddressBook addressBook : addressBooks) {
//            if (addressBook.getId() == 999999998) {
//                assert addressBook.getIsDefault() == 1&&addressBook.getAddress().equals("静园/静园1A/2楼/201")
//                        &&addressBook.getPhone().equals("18935372991");
//            }
//            flag += addressBook.getIsDefault();
//        }
//        //默认地址有且仅有一个
//        assert flag == 1;
//
//
//        //正常情况（默认改默认）
//        Result result2 = addressController.updateDefaultAddress(999999998);
//        assert result2.getCode() == 1;
//        //判断数据库内是否修改成功
//        int flag2 = 0;  //默认地址的个数
//        List<AddressBook> addressBooks2 = testMapper.selectAddressBook();
//        for (AddressBook addressBook : addressBooks2) {
//            if (addressBook.getId() == 999999998) {
//                assert addressBook.getIsDefault() == 1&&addressBook.getAddress().equals("静园/静园1A/2楼/201")
//                        &&addressBook.getPhone().equals("18935372991");
//            }
//            flag2 += addressBook.getIsDefault();
//        }
//        //默认地址有且仅有一个
//        assert flag2 == 1;
//    }
//    @Sql({"users1.sql","address_book0.sql",
//            "address_InsertOne.sql"})
//    //切换默认地址时openid错误
//    @Test
//    public void address_testUpdate_openid()  {
//        BaseContext.setCurrentId("oDk");
//        //id错误
//        Result result3 = addressController.updateDefaultAddress(999999998);
//        assert  result3.getCode()==0;
//
//        //判断数据库内是否修改成功
//        int flag3=0;  //默认地址的个数
//        List<AddressBook> addressBooks3 = testMapper.selectAddressBook();
//        for (AddressBook addressBook : addressBooks3) {
//            if (addressBook.getId()==999999998)
//            {
//                assert addressBook.getIsDefault()==0;
//            }
//            flag3+=addressBook.getIsDefault();
//        }
//        //默认地址有且仅有一个
//        assert flag3==1;
//
//    }
//
//
//    @Sql({"users1.sql","address_book0.sql",
//            "address_InsertOne.sql"})
//    @Test
//    //id错误
//    public void address_testUpdate_id()  {
//        BaseContext.setCurrentId("oD1dE6WKquXYcBKhX9vL9H90YsLk");
//        Result result3 = addressController.updateDefaultAddress(-1);
//        assert  result3.getCode()==0;
//        //判断数据库内是否修改成功
//        int flag3=0;  //默认地址的个数
//        List<AddressBook> addressBooks3 = testMapper.selectAddressBook();
//        for (AddressBook addressBook : addressBooks3) {
//            if (addressBook.getId()==-1)
//            {
//                assert addressBook.getIsDefault()==0;
//            }
//            flag3+=addressBook.getIsDefault();
//        }
//        //默认地址有且仅有一个
//        assert flag3==1;
//
//    }
//
//
//    //-----------------------------------删除地址---------------------------
//
//    @Sql({"users1.sql","address_book0.sql",
//            "address_InsertOne.sql"})
//    @Test
//    public void address_testDelete_success()  {
//        BaseContext.setCurrentId("oD1dE6WKquXYcBKhX9vL9H90YsLk");
//
//        //删除非默认
//        Result result = addressController.deleteAddress(999999998);
//        assert result.getCode()==1;
//        List<AddressBook> addressBooks = testMapper.selectAddressBook();
//        assert addressBooks.size()==1;
//
//        //删除默认
//        Result result2 = addressController.deleteAddress(999999999);
//        assert result2.getCode()==0;
//        List<AddressBook> addressBooks2 = testMapper.selectAddressBook();
//        assert addressBooks2.size()==1;
//    }
//
//    @Sql({"users1.sql","address_book0.sql",
//            "address_InsertOne.sql"})
//    @Test
//    //openid错误
//    public void address_testDelete_openid()  {
//        //openid有误
//        BaseContext.setCurrentId("oD1dE6RUZvrdNB3me_JxQnwcEyO4");
//
//        //删除非默认
//        Result result = addressController.deleteAddress(999999998);
//        assert result.getCode()==0;
//        List<AddressBook> addressBooks = testMapper.selectAddressBook();
//        assert addressBooks.size()==2;
//
//        //删除默认
//        Result result2 = addressController.deleteAddress(999999999);
//        assert result2.getCode()==0;
//        List<AddressBook> addressBooks2 = testMapper.selectAddressBook();
//        assert addressBooks2.size()==2;
//    }
//
//
//    @Sql({"users1.sql","address_book0.sql",
//            "address_InsertOne.sql"})
//    @Test
//    //id错误
//    public void address_testDelete_id() {
//        BaseContext.setCurrentId("oD1dE6WKquXYcBKhX9vL9H90YsLk");
//        Result result2 = addressController.deleteAddress(-1);
//        assert result2.getCode()==0;
//        List<AddressBook> addressBooks2 = testMapper.selectAddressBook();
//        assert addressBooks2.size()==2;
//    }
//
//    //-----------------------------------得到默认地址---------------------------
//    @Sql({"users1.sql","address_book0.sql",
//            "address_InsertOne.sql"})
//    @Test
//    //成功得到默认地址
//    public void address_testGetDelete_adddress() {
//        BaseContext.setCurrentId("oD1dE6WKquXYcBKhX9vL9H90YsLk");
//        Result<OutOrderVO> da = addressController.getDA();
//        assert da.getData().getAddress().equals("静园/静园1A/2楼/202");
//    }
//
//    @Sql({"users1.sql","address_book0.sql",
//            "address_InsertOne.sql"})
//    @Test
//    //openid错误
//    public void address_testGetDelete_openid() {
//        BaseContext.setCurrentId("oLk");
//        Result<OutOrderVO> da = addressController.getDA();
//        assert da.getData()==null;
//    }
//
//
//
//}
